获得当前计算机系统内所有的已启动的进程:
system.diagnostics.process[] processoncomputer = system.diagnostics.process.getprocesses();
foreach ( system.diagnostics.process p in processoncomputer )
{
system.console.writeline(p.tostring());
}
console.readline();
获得当前计算机系统内某个进程并关闭:
system.diagnostics.process[] process = system.diagnostics.process.getprocessesbyname("进程名称");
foreach ( system.diagnostics.process p in process)
{
p.kill();
}
新闻热点
疑难解答