Skip to content

How to get the name of the processes running on a system?

Deepak Upadhyay

Asked Jun 15, 2006, 7:54 PM EDT1 answer
Share
LinkedInX

I want to get a list of all the processes running on my system. The idea is to write a program which will run continiuosly on the system and will check if a perticular process is running and will take some decisions based on it.

Thanks,
Deepak

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    For this purpose, u need to reference the System.Diagnostics namespace. To retrieve all the processes running on a system, u can use the following code(C#) :-

    //Code

    Process[] objAllProcess= Process.GetProcesses();

    foreach(Process prc in objAllProcess)

    {

    //Do whatever you want to do with each process represented by the prc object.
    //This example will show each process name in a messagebox.
    MessageBox.Show(prc.ProcessName.ToString());

    }

    hope solved ur problem.

    0