System.out.println("本机IP:" + InetAddress.getLocalHost().getHostAddress().toString());System.out.println("主机名:" + InetAddress.getLocalHost().getHostName().toString());