Find all PCs in a network

I am using VB 2005

How can I search all active PCs in a network in vb.net

Regards

[100 byte] By [PeterK123] at [2008-2-23]
# 1

Hi,

If you know the range of their IP addreses you may be able to get the result of a PING test back in

VB.Net. I don't know how though, sorry.

--

I've just found this answer.>>

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=677061&SiteID=1

among these 90+ posts.>>

http://forums.microsoft.com/MSDN/Search/Search.aspx?words=ping&localechoice=9&SiteID=1&searchscope=forumgroupscope&ForumGroupID=10

Regards,

S_DS

Spidermans_DarkSide at 2007-9-4 > top of Msdn Tech,Visual Basic,Visual Basic Power Packs...
# 2

hi ,

thank's a lot i was trying to do it and can u tell me how to do it

your

narasiman.j

narasiman at 2007-9-4 > top of Msdn Tech,Visual Basic,Visual Basic Power Packs...
# 3
You could use a batch command to read out the net view info from your network and
then import this information into your program:

Code Snippet

'Read out the net view information and store it to C:\Temp.txt

'AppWinStyle.Hide hides the commandline window

'True waits for the net view command to finish before continueing

Shell("cmd.exe /c net view>C:\Temp.txt", AppWinStyle.Hide, True)

'The command above will write something like this in the text file:

'

'Server Name Remark

'

'-

'\\ADFLAP002 John Doe1

'\\AMSLAP006 John Doe2

'...

'Here we read out the computer names from the Temp.txt file

Dim ReadFile As New IO.StreamReader("C:\Temp.txt")

'loop until the end of the file is reached

Do Until ReadFile.EndOfStream = True

'Store the information from the currentline

Dim CurrentLine = ReadFile.ReadLine

'Only read out the computername if the line starts with '\\'

If (Mid(CurrentLine, 1, 2) = "\\") Then

'Read out the line from the 1st character to the first space and remove the '\\'

'(this is the computer name)

'write the computer name to the debug (Immediate) window

Debug.Print(Replace(Mid(CurrentLine, 1, InStr(CurrentLine, " ")), "\\", ""))

'InStr(CurrentLine, " ") => gets the location of the 1st space

'Mid(CurrentLine, 1, InStr(CurrentLine, " ")) => takes the string appart starting from 1 to the 1st space

End If

Loop

ReadFile.Close()

I hope this helps!

Greets,

Stitch

Stitch at 2007-9-4 > top of Msdn Tech,Visual Basic,Visual Basic Power Packs...