日期:2014-05-17 浏览次数:20897 次
/// <summary>
/// 结束进程
/// </summary>
/// <param name="name"></param>
private void FindAndKillProcessByName(string name)
{
//Find the named process and terminate it
foreach (Process winProc in Process.GetProcessesByName(name))
{
//use equals for the task in case we kill
//a wrong process
if (winProc.ProcessName.Equals(name))
{
winProc.Kill();
}
}
}