Listing Running Processes In C#.Net

1. Add List box on a Forms.
2. Now add a reference to System.Diagnostics
Code:


Process[] curProcesses = Process.GetProcesses();

            foreach (Process p in curProcesses)
            {
                listBox1.Items.Add(p.ProcessName);
            }


Output:

posted @ 2012-04-01 20:47  sandeepparekh9  阅读(149)  评论(0编辑  收藏  举报