用servlet获取IP等信息

xiaoxiao2021-02-28  124

Locale languageType=request.getLocale();//获取用户语言 String localIp=request.getLocalAddr();//获取本地ip int localPort=request.getLocalPort();//获取本地的端口 String localName=request.getLocalName();//获取本地计算机的名字 String remoteIp=request.getRemoteAddr();//获取客户端的ip int remotePort=request.getRemotePort();//获取客户端的端口号 String serverName=request.getRemoteHost();//获取远程计算机的名字
转载请注明原文地址: https://www.6miu.com/read-41882.html

最新回复(0)