using System.Diagnostics;
void DoWhateverYouWantWithYourProcess(Process process) { }
foreach (Process process in Process.GetProcesses())
DoWhateverYouWantWithYourProcess(process);
There is also an overloaded method:
Process[] Process.GetProcesses(string machineName)
.