+ Reply to Thread
Results 1 to 2 of 2

Thread: Process handling

  1. #1

    Process handling

    I'd like to know how to fetch the running processes names and kill any of them.
    Last edited by lilian; 11-12-2012 at 03:01 AM.

  2. #2
    Junior Member
    Join Date
    Jan 2012
    Posts
    36
    To get the name of running processes :
    Code:
    Foreach (Process p in Process.GetProcesses())
    {
        Console.WriteLine(p.ProcessName);
    }
    And to terminate a certain process :
    Code:
    foreach (Process p in Process.GetProcesses())
    {
        if (p.ProcessName.Contains("firefox"))
         {
            p.Kill();
         }
    }

+ Reply to Thread

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts