java 获取本机ip
public class Test3 { public static void main(String[] args) throws UnknownHostException { InetAddress inet = InetAddress.getLocalHost(); System.out.println("本机的ip=" + inet.getHostAddress()); }}
本文共 279 字,大约阅读时间需要 1 分钟。
java 获取本机ip
public class Test3 { public static void main(String[] args) throws UnknownHostException { InetAddress inet = InetAddress.getLocalHost(); System.out.println("本机的ip=" + inet.getHostAddress()); }}
转载于:https://www.cnblogs.com/kingxiaozi/p/3625421.html