-
I'm currently working on a program to communicate across the internet, but in order to do so, I need to be able to detect my IP address. As I am on a LAN, when I try to do this, it returns my LAN IP, whereas I need to get my internet IP. Is there a way to do this?
Thanks in advance,
Az.
-
Place the winsock control on thr form and a label then add this code.
Code:
Label1.Caption = Winsock1.LocalIP
Hope that helps,
D!m
-
I'm currently using the winsock control to communicate, and unfortunately, when you use the localip property, it returns the IP from the LAN, rather than your internet connection.
-
You have to start the winsock control after you are connected to the internet to get the Internet IP I think.
I was trying to get the same info and that was the easiest way I found, definately not the best though.
-
Unfortunately not, I have started the program many times after connecting to the internet, but with no luck.
-
hope it helps
While searching for the answer to the same problem, I came across a link to the following msn knowledge base page:
http://support.microsoft.com/support.../q160/2/15.asp
It has a loop in it to account for multi-homed addresses.
Dip
-
Thanks, Dip, that code did exactly what I was looking for.