I was looking around how to get a host's IP, this is the code I found. Thought might be useful to someone.
vb.net Code:
Public Sub GetHostsIP() Dim i As Integer Dim ipE As IPHostEntry = Dns.GetHostEntry("HostName") Dim IpA() As IPAddress = ipE.AddressList For i = 0 To IpA.GetUpperBound(0) Console.Write("IP Address {0}: {1} ", i, IpA(i).ToString) Next Console.WriteLine("Press any key to close") Console.ReadKey(True) End Sub



Reply With Quote

