I have a LAN with a few PC's and PLC's on the network.
The PLC's are a dedicated Controller with no names/drives etc... associated with them.
I would like to know if it is possible to retrieve all IP address's on a given network.
Thanks,
Steve.
Printable View
I have a LAN with a few PC's and PLC's on the network.
The PLC's are a dedicated Controller with no names/drives etc... associated with them.
I would like to know if it is possible to retrieve all IP address's on a given network.
Thanks,
Steve.
Test it:
How to display networked computers in a list box http://smalig.tripod.com/vb/119902.html
How to get an IP Address http://smalig.tripod.com/vb/109908.html
You must modify GetIPHostName() function from last sample.
------------------
Public Function GetIPHostName(sHostName$) As String
If Not SocketsInitialize() Then
GetIPHostName = ""
Exit Function
End If
GetIPHostName = Left$(sHostName, InStr(sHostName, Chr(0)) - 1)
SocketsCleanup
End Function
And call:
MsgBox "IP is " & GetIPHostName(Name_your_other_PC)
------------------
Best regards.
------------------
smalig
[email protected]
smalig.tripod.com
Thanks Smalig,
I've looked at the code and it seems to rely on being given the PC Name in order to return the IP address.
The other example lists all PC Names on the network. This would be fine except that not all machines on the network are PC's and therefore don't have a name (Well that I know of or that gets listed in by this code).
I need something similar to the example that lists all PC Names, except that it lists all used (or in use) IP address's on the network.
Thanks again,
Steve.