How can i make an application that show my extern IP address?
How can i make an application that show my extern IP address?
What OS?
Do you want show the IP for all interfaces on the system?
gg
Windows, i just want to write a console appliction that outputs my extern IP
or you can save some time and just run IPCONFIG from a command line.Code:#include <cstdlib> int main() { system( "ipconfig" ); return 0; }
Do you just want to check if you have an internet connection?
What's the end goal?
gg
Here's one of a few ways to enumerate your interfaces:
http://support.microsoft.com/kb/186312/en-us
gg
Go to http://www.ipchicken.com
That shows your REAL "external" IP address, as far as the rest of the Internet is concerned.
But that's not the IP address of MY computer, but of the other side of the set of router/firewall/proxy server stuff that ends up issuing the EXTERNAL IP-address. I can have two dozen machines this side of the network equipment, all with their completely separate IP addresses.
Also note that relying on IP address to stay static won't work if you use a DHCP server - then the address is likely to change every now and again - particularly if the machine is shut down and rebooted a day or two later, it's VERY likely to have a differnet IP-address.
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.