//最好在Program.cs中控制
static class Program
{
private static System.Threading.Mutex mutex;
///
/// 应用程序的主入口点。
///
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
mutex = new System.Threading.Mutex(true, “CardOnlyRun”);
if (mutex.WaitOne(0, false))
{
Application.Run(new IDCard.VistorInviteCode());
}
else
{
MessageBox.Show(“程序已启动!”);
Application.Exit();
}
//Application.Run(new Form1());
}
}
Winform 防止重复启动
最新推荐文章于 2023-12-15 10:09:12 发布