Getting Local IP address and HostName in Applet

webmasterbeta

New Member
Hello!I have tried to get the IP address and host name of the host running my Javaapplet using the following Java-Code:InetAddress inetadr = InetAddress.getLocalHost();System.out.println("LocalIP: " + inetadr.getHostAddress());System.out.println("LocalName: " + inetadr.getHostName());But I always get 127.0.0.1 and localhost is there any other way to determinethe name and IP address of my localhost???Can anyone help me?
 
Back
Top