public static void main(String[] args) throws UnknownHostException {
InetAddress inetAddress = Inet4Address.getLocalHost();
System.out.println(inetAddress.getHostAddress());
}
java获取ip地址
最新推荐文章于 2024-04-22 12:03:55 发布
public static void main(String[] args) throws UnknownHostException {
InetAddress inetAddress = Inet4Address.getLocalHost();
System.out.println(inetAddress.getHostAddress());
}