现在的位置: 首页 > 综合 > 正文

java读取IP的真实地址

2014年01月01日 ⁄ 综合 ⁄ 共 487字 ⁄ 字号 评论关闭
import com.handsome.ip.IPSeeker;
/**
 * @author shiyz
 * @creation date 2012-10-24 下午3:48:25
 *
 */
public class Test{
	public static void main(String[] args) {
		System.out.println(getIpLoaction("220.234.244.5"));
	}
	public static String getIpLoaction(String ip){
	    String ipFile="QQWry.Dat";
	    String ipPath="E://";
		IPSeeker ips=new IPSeeker(ipFile,ipPath); 
		//获得地区
		String address = ips.getIPLocation(ip).getCountry();
		String area = ips.getIPLocation(ip).getArea();
		return address + " " + area;
	}
}

http://download.csdn.net/download/shiyuezhong/4683674

【上篇】
【下篇】

抱歉!评论已关闭.