Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27153

[RESOLVED] IP help to type long error.

$
0
0
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 :?

Viewing all articles
Browse latest Browse all 27153

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>