InetAddress addr = InetAddress.getLocalHost();
ip=addr.getHostAddress().toString;//获得本机IP
address=addr.getHostName()toString;//获得本机名称
转载于:https://www.cnblogs.com/-lpf/p/4503023.html
InetAddress addr = InetAddress.getLocalHost();
ip=addr.getHostAddress().toString;//获得本机IP
address=addr.getHostName()toString;//获得本机名称
转载于:https://www.cnblogs.com/-lpf/p/4503023.html