Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting computer's IP address

Status
Not open for further replies.

Stevoie

Programmer
Jun 7, 2001
68
IE
i need a java program to get the IP address of the computer that its running on.
i've tried using the getlocaladdress on a connected socket but it gives me back 127.0.0.1, i need the actual IP address.

Any help would be great.
Thanx.
 
InetAddress localHost = InetAddress.getLocalHost();
System.out.println( localHost.getHostAddress() );

Dix
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top