ListBoxHello. I want all processes that are running on my system in a ListBox. Can you please tell me the code?
Code: foreach(Process p in Process.GetProcesses()) { listBox1.Items.Add(p.ProcessName); } If I were you I'd store it in a Dictionary<string, int> to get the ID of each process whenever you want, so you can gain access at it.
Originally Posted by ლ(ಠ_ಠლ) Code: foreach(Process p in Process.GetProcesses()) { listBox1.Items.Add(p.ProcessName); } If I were you I'd store it in a Dictionary<string, int> to get the ID of each process whenever you want, so you can gain access at it. Okay thanks dude.