import java.net.*;
public class LookIP {
public static void main(String[] args){
try{
InetAddress host = InetAddress.getLocalHost();
System.out.println("網域名稱: " + host.getHostName());
System.out.println("IP位址: " + host.getHostAddress());
}catch(Exception e){
e.printStackTrace();
}
}
}
沒有留言:
張貼留言