Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2014
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.34 KB | None | 0 0
  1. Enumeration e = NetworkInterface.getNetworkInterfaces();
  2. while(e.hasMoreElements())
  3. {
  4.     NetworkInterface n = (NetworkInterface) e.nextElement();
  5.     Enumeration ee = n.getInetAddresses();
  6.     while (ee.hasMoreElements())
  7.     {
  8.         InetAddress i = (InetAddress) ee.nextElement();
  9.         System.out.println(i.getHostAddress());
  10.     }
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement