java获取本机IP
public static void main(String[] args) throws UnknownHostException
{
InetAddress inet = InetAddress.getLocalHost();
System.out.println("本机的ip=" + inet.getHostAddress());
}
java获取本机IP
public static void main(String[] args) throws UnknownHostException
{
InetAddress inet = InetAddress.getLocalHost();
System.out.println("本机的ip=" + inet.getHostAddress());
}