使用Java取得本机IP和机器名
try { InetAddress addr = InetAddress.getLocalHost(); String ip=addr.getHostAddress().toString();//获得本机IP String host=addr.getHostName().toString();//获得本机名称
} catch(Exception e){ }
try { InetAddress addr = InetAddress.getLocalHost(); String ip=addr.getHostAddress().toString();//获得本机IP String host=addr.getHostName().toString();//获得本机名称
} catch(Exception e){ }