Results 1 to 1 of 1
-
How to get IP Address of the client
This example program extracts the IP address of the client and print to the console.
Java Code:import java.net.*; import java.io.*; import java.applet.*; public class GetClientIP extends Applet { public void init() { try { InetAddress thisIp = InetAddress.getLocalHost(); System.out.println("IP:"+thisIp.getHostAddress()); } catch(Exception e) { e.printStackTrace(); } } }
Similar Threads
-
Client IP Address
By goodjonx in forum NetworkingReplies: 3Last Post: 09-23-2009, 10:27 AM -
JSP – getting IP address
By Java Tip in forum Java TipReplies: 0Last Post: 01-29-2008, 09:05 AM -
Identify Client in Socket Client Server Application
By masadjie in forum NetworkingReplies: 1Last Post: 12-20-2007, 09:18 AM -
Getting host name/address
By Java Tip in forum Java TipReplies: 0Last Post: 11-19-2007, 04:34 PM -
I am not able to print Address
By Albert in forum New To JavaReplies: 1Last Post: 07-13-2007, 03:37 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks