static void Main()
{
#if false
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
//Application.Run(new frmdemo());
#else
bool ret = false;
System.Threading.Mutex running = new System.Threading.Mutex(true, Application.ProductName, out ret);
if (ret)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
//Application.Run(new Form1());
Application.Run(new frmdemo());
running.ReleaseMutex();
}
else
{
MessageBox.Show("程序已经在运行,请不要同时运行多个本程序!", "提示!", MessageBoxButtons.OK, MessageBoxIcon.Information);
Application.Exit();
}
#endif
}