Add this line to your use list:
using System.Diagnostics;
Now you can get the list of processes using the Process.GetProcesses() method, as shown in this example:
Process[] processlist = Process.GetProcesses(); foreach(Process theprocess in processlist) { Console.WriteLine("Process: {0} ID: {1}", theprocess.ProcessName, theprocess.Id); }
source share