Hi Vinziee , You can try the following code , also do not forget to Import System.Net In the following example we use the service of DNS , first we find the host of current computer then try to get list of computer from this DNS. I hope this works .
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
GetAllIP()
End Sub
Public Function GetAllIP() As Integer
Dim strHostName As New String("")
strHostName = Dns.GetHostName()
Console.WriteLine("Local Machine's Host Name: " + strHostName)
Dim ipEntry As IPHostEntry = Dns.GetHostEntry(strHostName)
Dim addr As IPAddress() = ipEntry.AddressList
Dim i As Integer = 0
While i < addr.Length
TextBox1.Text = TextBox1.Text & vbCrLf & String.Format("IP Address {0}: {1} ", i, addr(i).ToString())
System.Math.Max(System.Threading.Interlocked.Increment(i), i - 1)
Application.DoEvents()
End While
Return 0
End Function
-Regards Bharat Jain bharat.jain.nagpur@gmail.com