且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

列出并控制当前计算机/或远程计算机中的所有进程

更新时间:2022-12-24 13:00:39

using System.Diagnostics;

//...

void DoWhateverYouWantWithYourProcess(Process process) { /* some code */ }

//...

foreach (Process process in Process.GetProcesses())
    DoWhateverYouWantWithYourProcess(process);



还有一个重载的方法:
Process[] Process.GetProcesses(string machineName).



There is also an overloaded method:
Process[] Process.GetProcesses(string machineName).


请参见
http://csharptuning.blogspot.com/2007/05/getting- process-on-local-or-remote.html [ ^ ]

管理远程计算机上的进程 [ http://www.java2s.com/Tutorial/CSharp/0280__Development/Listingprocessesonaremotemachine.htm [ ^ ]
See
http://csharptuning.blogspot.com/2007/05/getting-processes-on-local-or-remote.html[^]

Manage Processes on Remote Machine[^]

http://www.java2s.com/Tutorial/CSharp/0280__Development/Listingprocessesonaremotemachine.htm[^]