Sorry for my qustions,but I'm still new in java and here i'm sure that I will get help from java pros.
I'm trying to get a users IP adress.I have the following code:
try {
InetAddress thisIp =InetAddress.getLocalHost();
lblIP.setText("IP:"+thisIp.getHostAddress());
}
catch(Exception e) {
e.printStackTrace();
}
It's compiling,without errors,but the output IP is not real....I mean,its just a random IP adress...
What I'm doing wrong...
Thanks in advance for any replay!
Edited by alex1, 05 February 2012 - 12:18 PM.


Sign In
Create Account


Back to top









