jsp获得本地及serverIP的方法
程序员文章站
2022-05-18 23:18:58
inetaddress addr = inetaddress.getlocalhost();
string ip = addr.gethostaddress().tostring();//获得本机i...
inetaddress addr = inetaddress.getlocalhost();
string ip = addr.gethostaddress().tostring();//获得本机ip
//访问的server的ip是:system.out.println("访问的ip是:" + ip);
//访问者的ip是:system.out.println("ip是:" + request.getremoteaddr());
上一篇: MySql优化分析