|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Get processes list problem (win 2000)I am trying to get the processes list from using the code attached. In win xp it works great but in win 2000 i get only one process the idle Any Ideas ? The Code : Dim Vec As System.Diagnostics.Process() Dim V As Object = Diagnostics.Process.GetProcesses.GetEnumerator Vec = Diagnostics.Process.GetProcesses For Each V In Diagnostics.Process.GetProcesses ListBox1.Items.Add(CType(V, Diagnostics.Process).ProcessName) Next -- Thank For The Help Eran -- Thank For The Help Eran ' Import
' ------- Imports System.Diagnostics ' Declaration ' ------------ Dim p As Process ' Behind a button: ' ---------------- ListBox1.BeginUpdate() ListBox1.Items.Clear() For Each p In Process.GetProcesses ListBox1.Items.Add(p.ProcessName) Next ListBox1.EndUpdate() Crouchie1998 BA (HONS) MCP MCSE Official Microsoft Beta Tester
Show quote
Hide quote
"Eran AMiel" <EranAM***@discussions.microsoft.com> schrieb: I doubt that this code works on Windows XP. Try this instead:> I am trying to get the processes list from using the code attached. > In win xp it works great but in win 2000 i get only one process the idle > Any Ideas ? > The Code : > > Dim Vec As System.Diagnostics.Process() > Dim V As Object = Diagnostics.Process.GetProcesses.GetEnumerator > > Vec = Diagnostics.Process.GetProcesses > For Each V In Diagnostics.Process.GetProcesses > ListBox1.Items.Add(CType(V, > Diagnostics.Process).ProcessName) > Next \\\ Imports System.Diagnostics .. .. .. For Each p As Process In Process.GetProcesses() Me.ListBox1.Items.Add(p.ProcessName) Next p /// -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/> You duplicated my code Herfried.
Crouchie1998 BA (HONS) MCP MCSE Official Microsoft Beta Tester "Crouchie1998" <crouchie1998@spamcop.net> schrieb: Sorry, I don't see any message of you in this thread -- my OE deleted some > You duplicated my code Herfried. messages because they are not available on the server any more (although they actually are...), maybe your message was one of them. -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/>
Help with Debugging
VB6 - Unable to read Text File Best way to get the value of one particular node of an XML string iHttpModule and Virtual Directories Custom Collections : overriding toString Response.Redirect("WebForm1.aspx") Sharing references/members VB.net Ablauf vom packen eines Projekts Application class problem DateDiff Error |
|||||||||||||||||||||||