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. list all running proccess in a textbox

list all running proccess in a textbox

Scheduled Pinned Locked Moved C#
tutorialquestion
7 Posts 2 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.
  • C Offline
    C Offline
    crash893
    wrote on last edited by
    #1

    Hi all am working on a small project for work part of the proccess is killing a proccess that is hung and i seem to be haveing trouble getting it to work i think i could probably get a better understanding if i knew how to list all the running proccess on a machine at any given time. does anyone know of an example that does this?

    K 1 Reply Last reply
    0
    • C crash893

      Hi all am working on a small project for work part of the proccess is killing a proccess that is hung and i seem to be haveing trouble getting it to work i think i could probably get a better understanding if i knew how to list all the running proccess on a machine at any given time. does anyone know of an example that does this?

      K Offline
      K Offline
      kubben
      wrote on last edited by
      #2

      You should look at the Process class. The GetProcesses method http://msdn2.microsoft.com/en-us/library/aa326948(VS.71).aspx[^] Ben

      C 1 Reply Last reply
      0
      • K kubben

        You should look at the Process class. The GetProcesses method http://msdn2.microsoft.com/en-us/library/aa326948(VS.71).aspx[^] Ben

        C Offline
        C Offline
        crash893
        wrote on last edited by
        #3

        System.Diagnostics.Process[] aProcesses = System.Diagnostics.Process.GetProcesses(); foreach (System.Diagnostics.Process p in aProcesses) { textBox2.Text = textBox2.Text + p.ToString() + System.Environment.NewLine; }

        K 1 Reply Last reply
        0
        • C crash893

          System.Diagnostics.Process[] aProcesses = System.Diagnostics.Process.GetProcesses(); foreach (System.Diagnostics.Process p in aProcesses) { textBox2.Text = textBox2.Text + p.ToString() + System.Environment.NewLine; }

          K Offline
          K Offline
          kubben
          wrote on last edited by
          #4

          Yep that should do it. Ben

          C 1 Reply Last reply
          0
          • K kubben

            Yep that should do it. Ben

            C Offline
            C Offline
            crash893
            wrote on last edited by
            #5

            any elegiant suggestion on how to remove the extra text that is given in the loop the system.diagnositc bla bla (firefox) i want it to just show up as firefox

            K 1 Reply Last reply
            0
            • C crash893

              any elegiant suggestion on how to remove the extra text that is given in the loop the system.diagnositc bla bla (firefox) i want it to just show up as firefox

              K Offline
              K Offline
              kubben
              wrote on last edited by
              #6

              There are a lot of properties in the Process class. So instead of p.ToString() Perhaps you could just do: p.ProcessName Ben

              C 1 Reply Last reply
              0
              • K kubben

                There are a lot of properties in the Process class. So instead of p.ToString() Perhaps you could just do: p.ProcessName Ben

                C Offline
                C Offline
                crash893
                wrote on last edited by
                #7

                thats it your good

                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