Here is my Prob- we have a main router from which we use a distributor or hub for internet connection distribution, ever computer connected automatically obtains IP address of format say - 180.50.50.xxx to access net connection.

if any connected computer has different IP format than the given one, it cannot access internet.

suppose my IPaddress is -
so all the IPs connected to my local network are of type- 180.50.50.xxx

if I want to view all connected IP address of computer that have internet connection

imports Net.Dns

Dim IP as string
'This gets my IP address and returns substring string IP as "180.50.50"
for i=0 to 255
if ping(IP + "." + i.ToString)
MsgBox ("IP FOUND " + IP + "." + i.ToString)
End if

but it takes too long to ping all IPs from 0 to 255
is there any other way in which I can see all Connected IPs even of those computer which are not accessing internet from my local network?

Edited by SpOOKy.Is.GoD: n/a

7 Years
Discussion Span
Last Post by ÜnLoCo

try this

Imports System.Net

Public Shared Function GetAllIP(Optional ByVal args As String() = Nothing) As Collection

        Dim strHostName As New String("")
        Dim col = New Collection
        ' 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)

        ' Then using host name, get the IP address list..
        Dim ipEntry As IPHostEntry = Dns.GetHostEntry(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())
            i += 1
        End While
        Return col
    End Function
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.