I don't know if I am asking in the right place, but I need to find my IP address within my program. You see, it is dynamic, and when my program starts, I want to put it into a text box. Any help?
Printable View
I don't know if I am asking in the right place, but I need to find my IP address within my program. You see, it is dynamic, and when my program starts, I want to put it into a text box. Any help?
the easiest way to go on this one is to use the Winsock control that comes with Vb. Check it the components list.
and then there is a property called localip or localadress or something..
ex. winsock.localaddress
if u got multiple IPs this will be a problem. Then u´ll have to go thru the WinsockAPI or a more advanced control.
good luck
VB Code:
Text1.Text = Winsock1.LocalIP
After adding the winsock component:
Code:Private Sub Form_Load()
Text1.Text = Winsock1.LocalIP
End Sub