Getting the IP Address and Hostname of the Local Machine
try {
InetAddress addr = InetAddress.getLocalHost();
// Get IP Address
byte[] ipAddr = addr.getAddress();
// Get hostname
String hostname = addr.getHostName();
} catch (UnknownHostException e) {
}
Good example. Thank you!
Gracias
Gracias!!!
danke szun!