Re: Getting client IP address
- From: "sivasu.india@xxxxxxxxx" <sivasu.india@xxxxxxxxx>
- Date: 8 Mar 2007 21:43:54 -0800
On Mar 9, 7:17 am, IchBin <wecon...@xxxxxxx> wrote:
Is there a way, using java.net, to get the IP address of the client PC
the java app is running.
Fooling around wit it and I only get the localhost address 127.0.0.1
--
Thanks in Advance... http://weconsultants.prophp.org
IchBin, Pocono Lake, Pa, USA http://ichbinquotations.awardspace.com
______________________________________________________________________
'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)
You can get the IP Address in the following way:
InetAddress addr = InetAddress.getLocalHost();
// Get IP Address
byte[] ipAddr = addr.getAddress();
// Get hostname
String hostname = addr.getHostName();
just try it out.
.
- References:
- Getting client IP address
- From: IchBin
- Getting client IP address
- Prev by Date: Re: New Venture - JAVA needed
- Next by Date: Re: Hibernate: having trouble saving a LIST of objects to database.
- Previous by thread: Re: Getting client IP address
- Next by thread: Re: Getting client IP address
- Index(es):