private static void KillProcess() { Process process1 = Process.GetCurrentProcess(); //获得当前计算机系统内某个进程并关闭: System.Diagnostics.Process[] process = System.Diagnostics.Process.GetProcessesByName(process1.ProcessName); foreach (System.Diagnostics.Process p in process) { if (p.Id != process1.Id) { p.Kill(); } } }
标签:exe,Process,winfrom,System,process,process1,Diagnostics,进程 From: https://www.cnblogs.com/lydj/p/16638375.html