private void KillProcess(string processName) { System.Diagnostics.Process myproc= new System.Diagnostics.Process(); //得到所有打开的进程 try{ foreach (Process thisproc in Process.GetProcessesByName(processName)) { if(!thisproc.CloseMainWindow()){ thisproc.Kill(); } } } catch(Exception Exc) { msg.Text+= "杀死" + processName + "失败!"; } }
强制杀死进程
最新推荐文章于 2023-04-16 12:28:08 发布