Display users IP Address[BASIC] 07-04-2013, 09:20 PM
#1
Well first you want to create a form with one button, and one label.
Design it how ever you want. Go in to the Code View and at the top of your code place import System.Net
Next, go back to design view and double click the button.
Place this code.
Start your program click the button and it should look like this:
![[Image: tqhWadp.png]](http://i.imgur.com/tqhWadp.png)
Design it how ever you want. Go in to the Code View and at the top of your code place import System.Net
Next, go back to design view and double click the button.
Place this code.
Code:
'Declare the webclient for downloading the string
Dim theClient As New WebClient
'Declare the string
Dim visitorIP As String
'Set the string as the result of the Web Client downloading the page(my website)
visitorIP = theClient.DownloadString("http://whatsmydetails.net/raw.php")
'Set the text of the label to the string
Label1.Text = "Your IP is: " & visitorIP
Start your program click the button and it should look like this:
![[Image: tqhWadp.png]](http://i.imgur.com/tqhWadp.png)
![[Image: GiXvY27.png]](http://i.imgur.com/GiXvY27.png)