get public ip address

hello i read a code somewhere on how you can get the public ip address from a website such has whatismyipaddress.comdoes anyone know how to get the ip address via from a site like that?
[199 byte] By [richard09a] at [2007-10-3 3:31:37]
# 1

> hello i read a code somewhere on how you can get the

> public ip address from a website such has

> whatismyipaddress.com

>

> does anyone know how to get the ip address via from a

> site like that?

You mean as in "open a URL connection and parse the returned content"?

CeciNEstPasUnProgrammeura at 2007-7-14 21:25:40 > top of Java-index,Java Essentials,Java Programming...
# 2
yup thats right
richard09a at 2007-7-14 21:25:40 > top of Java-index,Java Essentials,Java Programming...
# 3
u can do it using FTP protocolSUCH websites switch to ftp from http and try to transfer a temperary file
vipuluckya at 2007-7-14 21:25:40 > top of Java-index,Java Essentials,Java Programming...
# 4
> yup thats rightSo open a URLConnection and parse the content you get. :)
CeciNEstPasUnProgrammeura at 2007-7-14 21:25:40 > top of Java-index,Java Essentials,Java Programming...
# 5
> u can do it using FTP protocol> SUCH websites switch to ftp from http and try to> transfer a temperary fileI wish you would stop posting here.
CeciNEstPasUnProgrammeura at 2007-7-14 21:25:40 > top of Java-index,Java Essentials,Java Programming...
# 6
umm, is their any tutorials on how to do this?
richard09a at 2007-7-14 21:25:40 > top of Java-index,Java Essentials,Java Programming...
# 7
> umm, is their any tutorials on how to do this?Do what? Open a URLConnection? Read the API, it's not difficult. Read from a stream? Google for "Java IO Tutorial". Find specific data inside a String? Look at the String and Pattern APIs.
CeciNEstPasUnProgrammeura at 2007-7-14 21:25:40 > top of Java-index,Java Essentials,Java Programming...
# 8

> hello i read a code somewhere on how you can get the

> public ip address from a website such has

> whatismyipaddress.com

>

> does anyone know how to get the ip address via from a

> site like that?

Note that even once you figure out how to get and parse that data, it won't necessarily be your computer's public IP address. Your computer may not have a public IP address, in which case you'll just get the public IP of the router you're behind.

jverda at 2007-7-14 21:25:40 > top of Java-index,Java Essentials,Java Programming...
# 9
yea thats correct. what it needs is the routers public ip address so that i can access the computer inside the lan from the internet.
richard09a at 2007-7-14 21:25:40 > top of Java-index,Java Essentials,Java Programming...
# 10
> yea thats correct. what it needs is the routers> public ip address so that i can access the computer> inside the lan from the internet.That will only work if that router is doing some sort of NAT.
jverda at 2007-7-14 21:25:40 > top of Java-index,Java Essentials,Java Programming...
# 11
This came up just yesterday... http://forum.java.sun.com/thread.jspa?threadID=762802&tstart=0
RadcliffePikea at 2007-7-14 21:25:40 > top of Java-index,Java Essentials,Java Programming...
# 12

> u can do it using FTP protocol

> SUCH websites switch to ftp from http and try to

> transfer a temperary file

Dear lord you're an idiot.

I have been reading through your contributions here. They are... something. At any rate you are either a troll or a complete ******* idiot but no matter which please stop.

If you are a troll then troll somewhere else, driving newbies into the ditch is not very funny if you are for real then you need to wake up to the fact that you know far, far, far less about Java than you think. All your posts are filled with factual errors, poor grammar and demonstrate that the very little Java you do know is misunderstood on your part.

cotton.ma at 2007-7-14 21:25:40 > top of Java-index,Java Essentials,Java Programming...