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()) 54ne.com
{
if(thisproc!=null)
thisproc.Kill();
}
}
}
catch (Exception Exc)
{
throw Exc;
}
}
阅读(1021) | 评论(0) | 转发(0) |