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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to find my IP by programation?

Status
Not open for further replies.

haux

Programmer
Apr 11, 2001
79
DZ
How to find my IP by programation?

In my programme i must have the IP of the local PC. What function can do that?
i am using JDK 1.3 on Linux (Red Hat6.2).

Thanks for all;-)
 
import java.net.*;

public class MYIP
{
public static void main(String args[])
{
System.out.println(InetAddress.getLocalHost());
}

}


Regards
SnapJAck
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top