473,387 Members | 1,844 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Getting external IP Address

Hi, im using this code to get a computers IPAddress

Net.Dns.GetHostEntry(Net.Dns.GetHostName()).Addres sList(0)

but that only gets the Lan IPAddress....how can i get the internet IP address?
--
-iwdu15
Oct 15 '06 #1
4 2496
sorry about the double post....i got an error the first time i tried to post,
but apparently it went through anyway
--
-iwdu15
Oct 15 '06 #2

"iwdu15" <jmmgoalsteratyahoodotcomwrote in message
news:FE**********************************@microsof t.com...
sorry about the double post....i got an error the first time i tried to
post,
but apparently it went through anyway

No worries. Can't specifically answer your question, because the problem is,
it depends how you connect.
If you go through any kind of router/nat setup, the external address is
effectively unknown to your PC. It sends requests to it's default gateway
which then processes them. There are lots of websites out there (such as
www.whatsmyip.net) that can pick up the external address, so maybe you need
to look at somehow sending a request to one of these and processing it?
Oct 16 '06 #3
yea...i saw alot of things on that after doing a google search....i was
wondering, would connecting a socket to the same computer then checking the
remote end point work? i just want to avoid using any websites incase they
are unavailable for some reason....
--
-iwdu15
Oct 16 '06 #4

"iwdu15" <jmmgoalsteratyahoodotcomwrote in message
news:2E**********************************@microsof t.com...
yea...i saw alot of things on that after doing a google search....i was
wondering, would connecting a socket to the same computer then checking
the
remote end point work? i just want to avoid using any websites incase they
are unavailable for some reason....
Do you mean connecting to "yourself"? I don't think so, as it would be
clever enough to realise that it is within the local segment... the gateway
(and beyond) is only accessed when the computer doesn't "know" how to get to
the destination you give it - so anything on the same subnet will connect
"directly" (for want of a better phrase), whereas anything else will go to
the gateway...
Now, I guess you could try pinging a completely random address and not worry
if it's there or not, and see if the reply (from the gateway and whatever
it's gateway is) gives any information as to the external address? I'm not
sure it will, but perhaps worth a go - effectively you need to work out how
to do a traceroute... then it shouldn't matter if the remote site is up or
down.
I don't have code for doing that however, but a google may turn up
something...
James.
Oct 17 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: S. van Beek | last post by:
Dear reader, In case an application is ussing an external model library you have to address this external model library in your application. This addressing takes place in a module of the...
2
by: Tim | last post by:
Hi, I was wondering if anyone knows how to get the external IP address (the address beyond the router ) using C# code? Basically this is the address that appears on the internet. Thanks Tim
1
by: Lorne Smith | last post by:
Hi, I'm running a small network and need to get the external IP address of my router so that I can update my DNS forwarding service should my IP change (it's a dynamic one)... I can get the IP...
1
by: iwdu15 | last post by:
Hi, im trying to get the public IPAddress of a computer programmatically. I tried using Net.DNS.GetHostEntry(Net.Dns.GetHostName()).AddressList(0) but that only gives the inter-network...
4
by: fmaxwell | last post by:
Dear Group I have a very frustrating problem. I have been trying to make it more difficult to access external javascript files by using PHP sessions. This works beautifully locally (both in...
1
by: danknauf | last post by:
I have a webserver which is behaving strangely. The server is a fresh copy of Windows 2003 running IIS with default options + Active Server Pages installed. The server is connected to a Linksys...
8
by: Steven D'Aprano | last post by:
I have a PC behind a firewall, and I'm trying to programmatically determine the IP address visible from outside the firewall. If I do this: '127.0.0.1' ('localhost.localdomain', , ) I get...
41
by: LayneMitch via WebmasterKB.com | last post by:
I was just chating with a few webdevelopers and it was brought to my attention that I need some type of server technology installed on my computer so I could get a visual of how my sites would look...
4
by: remya1000 | last post by:
i'm using VB.NET 2003 Application program. i need to get External IP Address (internet). i searched internet and found come codes and tried that... i tried this code... but it returned my internal...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.