Here's a little function I use for getting the local IP.
Code:
Public Function LocalIP() As String
Dim h As System.Net.IPHostEntry = System.Net.Dns.GetHostByName(System.Net.Dns.GetHostName)
Return CType(h.AddressList.GetValue(0), Net.IPAddress).ToString
End Function
And here's one to find the Remote IP:
Code:
Public Function RemoteHostIP(ByVal _Client As Socket) As String
Dim iEP As IPEndPoint = _Client.RemoteEndPoint
Return iEP.Address.ToString
End Function
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.