That I don’t want to re-write in case my hard drive breaks, all public domain:
Private Function getLocalIp() As String
Dim myips As Net.IPHostEntry = System.Net.Dns.GetHostEntry(Net.Dns.GetHostName)
Dim myip As String = “127.0.0.1”
For Each ipaddress As Net.IPAddress In myips.AddressList
If ipaddress.ToString.Split(“.”).Count = 4 Then
If ipaddress.ToString <> “127.0.0.1” Then
myip = ipaddress.ToString
Exit For
End If
End If
NextReturn myip
End Function
Private Function ByteArToHex(ByVal byteAr As Byte())
Dim s1 As String = “”
For Each c1 As Byte In byteAr
s1 = s1 + String.Format(“{0:X2}”, c1)Next
Return s1End Function