Click here to Skip to main content
15,566,522 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
VB
Dim theprocess As System.Diagnostics.Process
        For Each theprocess.Threads.Item In Process.GetProcessesByName(Form1.TextBox1.Text)
            ListView1.Items.Add(theprocess.Threads)
        Next

I have to add a process threads to a listview
Any other way to do that?

Sorry for my english...
Posted
Comments
Sandeep Mewara 13-Jan-13 2:25am    
What error?

1 solution

You can't add threads directly to a listview - ProcessThread does n't override ToString, so all you would get is
System.Diagnostics.ProcessThread
for each one.
And you can't do it that way anyway!
VB
For Each p As Process In Process.GetProcessesByName(Form1.TextBox1.Text)
	Console.WriteLine(p)
	For Each pt As ProcessThread In p.Threads
		Console.WriteLine("   {0}", pt)
	Next
Next
Will at least give you some code that works as a starter!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900