How to find IP ADDRESS through java code
FIND IP ADDRESS
import java.net.InetAddress;
/**
*
* @author usman
*/
public class FindIp {
public static void main(String args[]) throws Exception
{
InetAddress myIP=InetAddress.getLocalHost();
/* public String getHostAddress(): Returns the IP
* address string in textual presentation.
*/
System.out.println("My IP Address is:");
System.out.println(myIP.getHostAddress());
}
}
0 Comments