• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

get IP, but not 127.0.0.1

 
Leandro Coutinho
Ranch Hand
Posts: 423
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 423
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdy!

I could solve my problem.

 
Mike Peters
Ranch Hand
Posts: 67
Debian Eclipse IDE Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can also iterate over the network interfaces in Java. For example:

 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic