by James Salim (7 Submissions)
Category: Internet/HTML
Compatability: Visual Basic 3.0
Difficulty: Beginner
Date Added: Wed 3rd February 2021
Rating:
(4 Votes)
When you use winsock to find your ip address, it will return you the ip of your internal network (if you have one). So this simple code is useful to find your real ip (the ip you use when connected to the internet).
Assumes
This is a simple code, to see it in action, you need to have a Winsock control in your component choices, and place it in your form and name it "Winsock".
Private Sub Form_Load()
Winsock.Connect "www.microsoft.com", 80
End Sub
Private Sub Winsock_Connect()
MsgBox "Your Real IP is: " + Winsock.LocalIP, vbOKOnly, "Real IP"
Winsock.Close
End Sub