I'm looking for a code that lists all computers in the LAN.
Is it possible? Is it difficult?
I'm doing the first steps in VB.
Help me. Thanks on advance
Printable View
I'm looking for a code that lists all computers in the LAN.
Is it possible? Is it difficult?
I'm doing the first steps in VB.
Help me. Thanks on advance
heres a class that does it, it can get other lists too such as shared list, printer list etc, i;ve attached the class, just add it to the project, and in your form load have something like thie....
Have a listbox on the form named lstTerminals
BTW i found this on pscode.com, theres probably more simpler versions, this was just the first I foundVB Code:
Dim SW As CNetworkEnum 'Decalre class Set SW = New CNetworkEnum 'Set class to SW Call SW.SetResourceType(0) 'Set resource type Call SW.Reset Dim ST As String ST = Replace(SW.GetServerList, "\\", "") 'Replace the \\ in the computer names 'loop through the list of computer names and put the in the listbox For i = 1 To Len(ST) If Mid(ST, i, 1) = "," Then lstTerminals.AddItem (Left(ST, i - 1)) ST = Right(ST, Len(ST) - i) i = 1 End If Next i
Thanks @the182guy for you reply.
I don't know how can I use it! I'm using VB .Net 2003.
How can I use the code and aply it to a listbox.
Sorry about the English but I'm a portuguese teenager.
And sorry for the ignorance!
Ah sorry, I thought you were using VB6, that code is for VB6, possibly you can use the class in .NET but I really have no idea, try posting in the .NET or API forum as this question is API related and technically is not actually network programming
Owever, thanks for all!
Microbyte