| | |
| | | [STAThread] |
| | | static void Main() |
| | | { |
| | | |
| | | Application.EnableVisualStyles(); |
| | | Application.SetCompatibleTextRenderingDefault(false); |
| | | Application.Run(new frmMain()); |
| | | bool ret; |
| | | System.Threading.Mutex mutex = new System.Threading.Mutex(true, Application.ProductName, out ret); |
| | | |
| | | |
| | | string name = Application.ProductName; |
| | | |
| | | if (ret) |
| | | { |
| | | Application.EnableVisualStyles(); |
| | | Application.SetCompatibleTextRenderingDefault(false); |
| | | Application.Run(new frmMain()); |
| | | } |
| | | else |
| | | { |
| | | MessageBox.Show(null, "有一个和本程序相同的应用程序已经在运行,请不要同时运行多个本程序。\n\n这个程序即将退出。", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Warning); |
| | | Application.Exit();//退出程序 |
| | | } |
| | | } |
| | | } |
| | | } |