static class Program { private static Mutex onlyOne; /// <summary> /// 应用程序的主入口点。 /// </summary> [STAThread] static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); onlyOne = new Mutex(true, Process.GetCurrentProcess().ProcessName); if (onlyOne.WaitOne(0, false)) { Application.Run(new frmRelease()); } else { MessageBox.Show("应用程序已启动!"); } } }