Code Repo    |     RSS
MD's Technical Sharing



Saturday, January 31, 2009

Retrieve all current IP addresses of the machine

For i As Integer = 0 To IPEntry.AddressList.Length - 1
Try
Dim thisEntry As IPAddress = IPEntry.AddressList(i)
If thisEntry.AddressFamily = Sockets.AddressFamily.InterNetwork Then
Debug.WriteLine(thisEntry.ToString + " " + thisEntry.AddressFamily.ToString)
End If
Catch ex As Exception
Debug.WriteLine("Error: " + ex.Message)
End Try
Next

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.