-
Oct 16th, 2013, 11:56 AM
#1
Thread Starter
Junior Member
[RESOLVED]Get a List of Running Processes
I am making a program which shows all system information , and inside a Richtextbox I would like it to show list of running processes. However I would like to dim the entire list , so for example :
Code:
Dim processes as String
processes = (code to get list of running processes)
then I could display it easily in a message box or in a textbox
Code:
Msgbox(processes)
textbox1.text = processes
Hope any of this makes sense.
Last edited by trueboss926; Oct 17th, 2013 at 06:25 AM.
-
Oct 16th, 2013, 02:12 PM
#2
Re: Get a List of Running Processes
I have to ask, have you done a Google search. I literally had 1000s of Answers searching for ".net list processes". You should find examples using this method: http://msdn.microsoft.com/en-us/library/1f3ys1f9.aspx
Last edited by Grimfort; Oct 16th, 2013 at 02:30 PM.
-
Oct 16th, 2013, 03:11 PM
#3
Re: Get a List of Running Processes
-
Oct 16th, 2013, 03:19 PM
#4
Fanatic Member
Re: Get a List of Running Processes
Hi
another addition...
using a messagebox is likely going to end up with a box so big it doesnt fit on the screen, look into using a custom form with a listbox so your can scroll through and keep the ui tidy, and there is no point putting it into a string as it comes in a list anyway, just put it straight to the listbox.
Yes!!!
Working from home is so much better than working in an office...
Nothing can beat the combined stress of getting your work done on time whilst
1. one toddler keeps pressing your AVR's power button
2. one baby keeps crying for milk
3. one child keeps running in and out of the house screaming and shouting
4. one wife keeps nagging you to stop playing on the pc and do some real work.. house chores
5. working at 1 O'clock in the morning because nobody is awake at that time
6. being grossly underpaid for all your hard work
-
Oct 16th, 2013, 03:33 PM
#5
Thread Starter
Junior Member
Re: Get a List of Running Processes
Originally Posted by Grimfort
Okay I looked and tried the following code, for a button event:
Code:
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Dim localAll As Process() = Process.GetProcesses()
MsgBox(localAll.ToString)
End Sub
The message box displays "System.Diagostics.Process[]" . In my case I want to incorporate the list into a richtextbox. I used a messagebox as an example to see if it would display correctly. Since messagebox shows just plain text, I tried to display it on richtextbox but instead it shows the same message.
Last edited by trueboss926; Oct 16th, 2013 at 03:46 PM.
-
Oct 16th, 2013, 03:38 PM
#6
Thread Starter
Junior Member
Re: Get a List of Running Processes
Originally Posted by BenJones
As I said , I would like to put them inside a richtextbox format.
Last edited by trueboss926; Oct 16th, 2013 at 03:41 PM.
-
Oct 16th, 2013, 03:51 PM
#7
Re: Get a List of Running Processes
Originally Posted by trueboss926
As I said , I would like to put them inside a richtextbox format.
Process has many properties, if you just want to list their names in a RTB you could try something like,
Code:
Dim procNames As String = String.Empty
Dim localAll As Process() = Process.GetProcesses()
For Each p In localAll
procNames &= p.ProcessName & Environment.NewLine
Next
RichTextBox1.Text = procNames
-
Oct 17th, 2013, 06:24 AM
#8
Thread Starter
Junior Member
Re: Get a List of Running Processes
Thanks it is exactly how I described.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|