public String getLocalIp(){
InetAddress inetAddress=InetAddress.getLocalHost();
String ip=inetAddress.getHostAddress().toString();//获得本机Ip
return ip;
}
java如何获得本机IP
最新推荐文章于 2024-06-28 17:01:04 发布
public String getLocalIp(){
InetAddress inetAddress=InetAddress.getLocalHost();
String ip=inetAddress.getHostAddress().toString();//获得本机Ip
return ip;
}