C#Mutex的使用

bool blFlag = false;
Mutex mtx = new Mutex(false, "Form1", out blFlag);
if (!blFlag)
{
MessageBox.Show("软件已启动");
Application.Exit();
}
else
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new frmMain());
}

原文地址:https://www.cnblogs.com/VictorBlog/p/11131451.html