import java.net.UnknownHostException;
public static void main(String[] args) throws UnknownHostException {
String hostAddress = Inet4Address.getLocalHost().getHostAddress();
System.out.println(hostAddress);// 192.168.56.1
}
获取本机IP地址
最新推荐文章于 2024-04-07 11:27:49 发布