The only reliable way to get your external IP address (Router or modem) of
your PC or network is to make a http call to a server which will tell you.
EG - whatismyip.com have a page where you can make automated http requests
and the server will simply give you the IP as a response with no other code:
The address is:
http://www.whatismyip.com/automation/n09230945.asp
You will simply get one line of text which will be the external IP.
To get the internal IP is a bit more fiddly as it depends on how many
network cards you have in the machine (and thats only one issue). Most
people use Winsock APIs to get it but I'm not sure how well that works with
multiple NICs. Also Indy has an IPWatch component which I think will give
you internal IP information.
Good luck
JD
Post by Richard BibbyHej,
Is there a good way to find my internal IP address, and also my external
ip address programically?
Many thanks.
/Richard