Sunday, January 31, 2010

JAVA pgm to detect IP address

import java.net.InetAddress;
import java.net.UnknownHostException;

public class ToDetectIPAdress {

public static void main(String[] args) {
try {
System.out.println(InetAddress.getLocalHost().getHostName());
System.out.println(InetAddress.getLocalHost().getHostAddress());

} catch (UnknownHostException e) {
e.printStackTrace();
}

}

}
--*--

No comments:

Post a Comment

How to Put Google Adsense Below Post Title in Blogger?

Adsense is used by  majority  of expert bloggers for their website monetization because it is a cookie based contextual advertising syste...