import java.net.*;
class IPChangeEveryMinute{
public static void main(String[] args) {
getIPAddresses();
}
public static void getIPAddresses() {
try {
InetAddress in = InetAddress.getLocalHost();
InetAddress[] x= InetAddress.getAllByName(in.getHostName());
for (int i = 0; i < x.length; i++) {
System.out.println(x[i].getHostAddress());
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
No comments:
Post a Comment