bool create;
using (Mutex mu = new Mutex(true, Application.ProductName, out create))
{
if (create)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Main());
}
else
{
MessageBox.Show("程序已经运行!");
}
}
快乐而轻松的写代码