取得本机的用户名和IP

System.out.println(InetAddress.getLocalHost().getHostName());

System.out.println(InetAddress.getLocalHost().getHostAddress());

你可能感兴趣的:(取得本机的用户名和IP)