public static void KillProcess(string processName)  
{
System.Diagnostics.Process myproc = new System.Diagnostics.Process();
//得到所有打开的进程
try
{
foreach (Process thisproc in Process.GetProcessesByName(processName))
{
if (!thisproc.CloseMainWindow())
{
if (thisproc != null)
thisproc.Kill();
}
}
}
catch (Exception Exc)
{
throw Exc;
}
}

 

用法:

KillProcess("Excel");  

参考:http://www.wxzzz.com/?id=63

相关文章:

  • 2021-11-17
  • 2022-02-25
  • 2021-12-18
  • 2022-12-23
  • 2021-08-02
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-10-02
  • 2021-11-27
  • 2022-02-07
  • 2022-12-23
  • 2021-07-22
相关资源
相似解决方案