IP Address
6 posts
• Page 1 of 1
IP Address
Does anyone know how to display your IP in VB.NET? I got this code from abstractvb but it dosent work
'Dim h As System.Net.IPHostEntry = System.Net.Dns.GetHostByName(System.Net.Dns.GetHostName)
TextBox1.Text(CType(h.AddressList.GetValue(0), IPAddress).ToString)'
But 'IPAddress' (in italics) is underlined blue and says 'Type 'IPAddress' is not defined.' Can someone please help or tell me another way to find my IP using VB.NET?
Thanks
-Jonny
- jonnywright
- Banned
- Posts: 53
- Joined: Thu Aug 14, 2003 10:25 pm
- Location: Leicester UK
of first you need to import System.Net, System.Net.Sockets
then to go with your code
Dim IPAddress As New IPAddress(Dns.GetHostByName(Dns.GetHostName).AddressList(0).Address)
TextBox1.Text(IPAddress.ToString)
then to go with your code
Dim IPAddress As New IPAddress(Dns.GetHostByName(Dns.GetHostName).AddressList(0).Address)
TextBox1.Text(IPAddress.ToString)
<a href="http://www.secretsofwar.net/index.asp?referer=injunfarian" target=_blank>Good Webbased Game</a>
<a href="http://selectaz.com" target=_blank><img src="http://selectaz.com/popup/stats.php" border=0></a>
<a href="http://selectaz.com" target=_blank><img src="http://selectaz.com/popup/stats.php" border=0></a>
- Injunfarian
- Posts: 63
- Joined: Sat Jan 18, 2003 8:15 pm
Injunfarian, extremely grateful! Thank you very much, it was really starting to get on my nerves!
Nice one!
-Jonny
Nice one!
-Jonny
- jonnywright
- Banned
- Posts: 53
- Joined: Thu Aug 14, 2003 10:25 pm
- Location: Leicester UK
np.
<a href="http://www.secretsofwar.net/index.asp?referer=injunfarian" target=_blank>Good Webbased Game</a>
<a href="http://selectaz.com" target=_blank><img src="http://selectaz.com/popup/stats.php" border=0></a>
<a href="http://selectaz.com" target=_blank><img src="http://selectaz.com/popup/stats.php" border=0></a>
- Injunfarian
- Posts: 63
- Joined: Sat Jan 18, 2003 8:15 pm
6 posts
• Page 1 of 1
Return to HTML, CSS, and Scripts
Who is online
Users browsing this forum: No registered users and 4 guests