Private Function GetIPAddress() As IPAddress
Dim oAddr As System.Net.IPAddress
Dim sAddr As String
Dim host As String = System.Net.Dns.GetHostName()
With System.Net.Dns.GetHostByName(System.Net.Dns.GetHostName())
Dim jakes As Long = CType(System.Net.Dns.GetHostByName(host).AddressList(1).MapToIPv4.ToString, Long)
If .AddressList.Length > 0 Then
oAddr = New IPAddress(jakes)
End If
End With
GetIPAddress = oAddr
End Function
The code i'm using there is another code inside that that isn't doing anything that's because it's the original and it gave me some weird ip like 25. something i want GetIPAddress to = my local ipv4 which is 192.168.0.2 any help :?
Dim oAddr As System.Net.IPAddress
Dim sAddr As String
Dim host As String = System.Net.Dns.GetHostName()
With System.Net.Dns.GetHostByName(System.Net.Dns.GetHostName())
Dim jakes As Long = CType(System.Net.Dns.GetHostByName(host).AddressList(1).MapToIPv4.ToString, Long)
If .AddressList.Length > 0 Then
oAddr = New IPAddress(jakes)
End If
End With
GetIPAddress = oAddr
End Function
The code i'm using there is another code inside that that isn't doing anything that's because it's the original and it gave me some weird ip like 25. something i want GetIPAddress to = my local ipv4 which is 192.168.0.2 any help :?