两种方式
public static void ApplicationRestart() { mutex.Close(); Application.Exit(); Application.Restart(); Environment.Exit(0); } public static void ProcessRestart() { mutex.Close(); Process.Start(Assembly.GetExecutingAssembly().Location); Application.Exit(); Environment.Exit(0); }
关键是 Environment.Exit(0);