Process[] ps = Process.GetProcesses();//获取计算机上所有进程
foreach (Process p in ps)
{
if (p.ProcessName == "QQ")//判断进程名称
{
p.Kill();//停止进程
}
}
有
System.Diagnostics.Process[] qqs = System.Diagnostics.Process.GetProcessesByName("QQ.exe");
arr[0].Kill();
如果关闭多个qq进程,那么久用for循环kill