Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Enumeration e = NetworkInterface.getNetworkInterfaces();
- while(e.hasMoreElements())
- {
- NetworkInterface n = (NetworkInterface) e.nextElement();
- Enumeration ee = n.getInetAddresses();
- while (ee.hasMoreElements())
- {
- InetAddress i = (InetAddress) ee.nextElement();
- System.out.println(i.getHostAddress());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement