//如何批量關(guān)閉某一進(jìn)程,用以下代碼可以實(shí)現(xiàn)(Ps:以下是.net代碼實(shí)現(xiàn)關(guān)閉php-cgi.exe進(jìn)程的方法)
try
{
int num = 0;
Process[] ps = Process.GetProcesses();
foreach (Process item in ps)
{
if (item.ProcessName == "php-cgi")
{
if (num > 0)
{
item.Kill();
}
num++;
}
}
}
catch { }
更多信息請(qǐng)查看IT技術(shù)專(zhuān)欄