using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace MsHtmlDemo
{
static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
bool creatednew = false;
using (Mutex mutex = new Mutex(true, Application.ProductName, out creatednew))
{
if (creatednew)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
else
{
MessageBox.Show("程序已运行",Application.ProductName);
Environment.Exit(1);
}
}
}
}
}
c# 只允许一个程序允许
最新推荐文章于 2023-07-11 14:22:42 发布