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