Hack Forums
[.NET] IP Display VB.NET - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [.NET] IP Display VB.NET (/showthread.php?tid=4129117)



IP Display VB.NET - airplanejoe - Mar 22, 2014

How do you display someone's IP in VB.NET?

Like;

Your IP is:
[ IP HERE ]


* - geraldososa - Mar 22, 2014

(Mar 22, 2014 02:41 PM)airplanejoe Wrote:  How do you display someone's IP in VB.NET?

Like;

Your IP is:
[ IP HERE ]

Using web As New WebClient()
Dim ip As String = web.DownloadString("http://rstown.x10.mx/chat/getip.php")
Label1.text = ip
End Using


* - Devchan - Mar 22, 2014

There are plenty of sites that dump the IP as text:

http://cfaj.freeshell.org/ipaddr.cgi

You could just do webclient.DownloadString()

EDIT: Geraldososa beat me to it. :(


* - airplanejoe - Mar 22, 2014

Thanks guys! I needed it for a VPN program I am making - seems stupid but it really isn't. Thanks very much!


Uh, somehow it isn't working, It says "Type 'webclient' is not defined".

Could you help me out, please? I'm using Visual Basic 2008 Express Edition


* - Devchan - Mar 22, 2014

(Mar 22, 2014 03:09 PM)airplanejoe Wrote:  Thanks guys! I needed it for a VPN program I am making - seems stupid but it really isn't. Thanks very much!


Uh, somehow it isn't working, It says "Type 'webclient' is not defined".

Could you help me out, please? I'm using Visual Basic 2008 Express Edition

Have you used my snipped or the one the other person posted? Because you would need to define the webclient.

http://msdn.microsoft.com/en-us/library/fhd1f0sw(v=vs.110).aspx


* - geraldososa - Mar 22, 2014

(Mar 22, 2014 03:09 PM)airplanejoe Wrote:  Thanks guys! I needed it for a VPN program I am making - seems stupid but it really isn't. Thanks very much!


Uh, somehow it isn't working, It says "Type 'webclient' is not defined".

Could you help me out, please? I'm using Visual Basic 2008 Express Edition
Imports System.Net
Please don't make a vpn program if you don't know how to use a webclient.


* - Vexane - Mar 23, 2014

This little snippet will store the users IP address inside the variable "ip".
[Image: 6PLJGXv.png]

Hope I helped!


* - Venom‎ - Mar 24, 2014

Do you want it of the local computer?