Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Listing information of backgroud process

Listing information of backgroud process

Scheduled Pinned Locked Moved C#
csharpquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sarang_k
    wrote on last edited by
    #1

    Hi all, In c# application how can i list the complete detailed information of running background process of a system. Thanks in advance.

    C A 2 Replies Last reply
    0
    • S sarang_k

      Hi all, In c# application how can i list the complete detailed information of running background process of a system. Thanks in advance.

      C Offline
      C Offline
      CodingLover
      wrote on last edited by
      #2

      You can find the complete list with, Process.GetProcesses(); and then pick the properties of all process such as, ProcessName ID TotalProcessorTime StartTime etc Please check spellings for all properties above. Read the documentation about the Process as well. After that actually it's matter of control/use/display them as you wish.

      I appreciate your help all the time... CodingLover :)

      1 Reply Last reply
      0
      • S sarang_k

        Hi all, In c# application how can i list the complete detailed information of running background process of a system. Thanks in advance.

        A Offline
        A Offline
        ambarishtv
        wrote on last edited by
        #3

        Hi.. try this code.. :)

        using System;
        using System.Diagnostics;

        class MainClass
        {
        public static void Main()
        {
        Process[] allProcs = Process.GetProcesses();

          foreach(Process proc in allProcs)
          {
             ProcessThreadCollection myThreads = proc.Threads;
             Console.WriteLine("process: {0},  id: {1}", proc.ProcessName, proc.Id);
        
             foreach(ProcessThread pt in myThreads)
             {
                Console.WriteLine("  thread:  {0}", pt.Id);
                Console.WriteLine("    started: {0}", pt.StartTime.ToString());
                Console.WriteLine("    CPU time: {0}", pt.TotalProcessorTime);
                Console.WriteLine("    priority: {0}", pt.BasePriority);
                Console.WriteLine("    thread state: {0}", pt.ThreadState.ToString()); 
             }
          }
        

        }
        }

        -ambarish-

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups