计算机ip地址获取

来源:互联网 发布:卡盟源码官方最新 编辑:程序博客网 时间:2024/06/07 23:56

System.out.println("IP获取"+request.getRemoteAddr());


System.out.println(" 端口号"+request.getRemotePort());

String hostAddress = InetAddress.getLocalHost().getHostAddress().toString(); 


System.out.println("hostAddress:" + hostAddress);

       

 String hostName = InetAddress.getLocalHost().getHostName();  

       

 System.out.println("hostName:" + hostName);



0 0