How to get all IP address on a LAN network
The following code sample shows how to get all IP address on a LAN network
Must have a reference to System.Net.DLL in your reference list.
Imports System.Net
Public Shared Function GetAllIP(Optional ByVal args As String() = Nothing) As Integer
'args in the signature is optional, without it
'the function will simply get the hostname
'of the local machine then go from there
Dim strHostName As New String("")
If args.Length = 0 Then
' Getting Ip address of local machine...
' First get the host name of local machine.
strHostName = DNS.GetHostName()
Console.WriteLine("Local Machine's Host Name: " + strHostName)
Else
strHostName = args(0)
End If
' Then using host name, get the IP address list..
Dim ipEntry As IPHostEntry = DNS.GetHostByName(strHostName)
Dim addr As IPAddress() = ipEntry.AddressList
Dim i As Integer = 0
While i < addr.Length
Console.WriteLine("IP Address {0}: {1} ", i, addr(i).ToString())
System.Math.Max(System.Threading.Interlocked.Increment(i), i - 1)
End While
Return 0
End Function

Thank you ,Thank you and more Thanks