日期:2014-05-17 浏览次数:20513 次
static Process[] process; public static void KillProcess() { process = System.Diagnostics.Process.GetProcesses(); foreach (Process p in process) { if (p.ProcessName.ToLower() == "excel") { p.Kill(); } } }
------解决方案--------------------
public void Kill()
{
Process[] process = System.Diagnostics.Process.GetProcesses();
foreach (Process p in process)
{
if (p.ProcessName.ToLower() == "winword")
{
p.Kill();
}
}
}