Saturday, March 13, 2010

IP ADDRESS IN JAVA APPLET

You can use the following code snippet to get the IP address in an applet:

String ip = (new Socket(getDocumentBase().getHost(), getDocumentBase().getPort()))
.getLocalAddress().getHostAddress();

No comments:

Post a Comment