how to find my external IP

N

nescafe

I need to develop one program which will:
- find my external IP address
- save this address into some string
- write this address into one file.


Any idea what should i use ( for first two options ) ?

Regards!
 
D

Daniel Pitts

I need to develop one program which will:
- find my external IP address
- save this address into some string
- write this address into one file.


Any idea what should i use ( for first two options ) ?

Regards!

Read:
http://www.whatismyip.com/faq/automation.asp

After reading this, the easiest thing to do is use the "curl" command
(for unix based OSes, including MacOS). You would curl the automation
URL (that is linked to from the above page) and redirect the output to
the file. Note, I'm not providing the direct link, because
whatismyip.com has specific TOS requirements.

The other perhaps more reliable but more difficult solution is to
"scrape" your routers admin pages. This works until you change routers,
or your router-firmware makes a change that isn't compatible with your
scraping. YMMV. whatismyip.com is fairly canonical.
 
A

Arne Vajhøj

I need to develop one program which will:
- find my external IP address
- save this address into some string
- write this address into one file.


Any idea what should i use ( for first two options ) ?

To get the external IP address you need to ask a service
on the outside.

Such services exist, but you can also deploy your own
on some free/cheap server somewhere.

Arne
 
R

Roedy Green

I need to develop one program which will:
- find my external IP address
- save this address into some string
- write this address into one file.

see http://mindprod.com/jgloss/ip.html
--
Roedy Green Canadian Mind Products
http://mindprod.com
When you were a child, if you did your own experiment
to see if it was better to put to cocoa into your cup first
or the hot milk first, then you likely have the programmer gene..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top