i want to get internet ip address when i m sitting on server of a LAN...
winsock1.localip gives me just LOCAL i.1p like 192.168.0.1
i want to get both this one ant Internet Ip as well from vb code.. thx :mike:
Printable View
i want to get internet ip address when i m sitting on server of a LAN...
winsock1.localip gives me just LOCAL i.1p like 192.168.0.1
i want to get both this one ant Internet Ip as well from vb code.. thx :mike:
well when you are behind a router your computer can't tell that there is a wan IP address... so I don't know how you would be able to get this information via code. If someone has an answer I would like to see it as well, because as far as I know it isn't possible
yea i've been looking into it, the only way i can think of doing it (i cnat find an api either) is going to a page such as www.whatismyip.com and looking there (i'm not sure about code)Quote:
Originally Posted by kleinma
I'll see what i cna find though because it is an interesting point
This page is just a SSI script.
Probably this one:
I believe you could make a prog that grubs the info from this page.Code:<!--#echo var="REMOTE_ADDR" -->
I don’t think there’s a way of knowing the IP that is given to you by your isp cuz it comes till your router.
In other words it doesn’t reach your PC…
Haven't tested this :Quote:
Originally Posted by Pino
VB Code:
Dim strName As String Private Sub Form_Load() txtUrl.Text = "http://checkip.dyndns.org/" txtIP = (Inet1.OpenURL(txtUrl.Text)) strName = Replace(txtIP, "<html><head><title>Current IP Check</title></head><body>Current IP Address: ", "") strName = Replace(strName, "</body></html>", "") txtIP.Text = strName End Sub
Thats what i was thinking a way to parse the HTML, but couldnt think how to do it :)Quote:
Originally Posted by manavo11
Pino
yea its impossible to get the external ip unfortunatly without using something on the "outside" to comunicate with :(
i used to use a free hosting site brinkster.com and just returned the clients ip in an asp page there
Just came accross this : http://vbnet.mvps.org/index.html?cod...etpublicip.htm
its still an "outside" source though...Quote:
Originally Posted by manavo11
Quote:
have a page at http://vbnet.mvps.org/resources/tools/getpublicip.shtml that can be used by anyone to return their public IP address
I know... It seems impossible to avoid...Quote:
Originally Posted by kleinma
Because it IS impossible to DO.