网络编程有关
1.获取本地ip地址
import java.net.InetAddress;
public static void main(String[] args) throws UnknownHostException{
InetAddress host=InetAddress.getLocalHost();
String ip=host.getHostAddress();
System.out.println(ip);
}
网络编程有关
1.获取本地ip地址
import java.net.InetAddress;
public static void main(String[] args) throws UnknownHostException{
InetAddress host=InetAddress.getLocalHost();
String ip=host.getHostAddress();
System.out.println(ip);
}