| Author |
get IP, but not 127.0.0.1
|
Leandro Coutinho
Ranch Hand
Joined: Mar 04, 2009
Posts: 415
|
|
Howdy!
How can I get IP, but not 127.0.0.1.
Thank you!
java.net.InetAddress i = java.net.InetAddress.getLocalHost();
System.out.println(i.getHostAddress());
|
 |
Leandro Coutinho
Ranch Hand
Joined: Mar 04, 2009
Posts: 415
|
|
Howdy!
I could solve my problem.
|
 |
Mike Peters
Ranch Hand
Joined: Oct 10, 2009
Posts: 67
|
|
You can also iterate over the network interfaces in Java. For example:
|
Mike Peters
|
 |
 |
|
|
subject: get IP, but not 127.0.0.1
|
|
|