C#判断进程是否存在并结束进程

            System.Diagnostics.Process[] processList = System.Diagnostics.Process.GetProcesses();
foreach (System.Diagnostics.Process process in processList)
{
if (process.ProcessName.ToUpper() == "WINRAR")
{
MessageBox.Show("Y");
            process.Kill(); //结束进程
}
}

 

展开阅读全文

没有更多推荐了,返回首页