public static IPLocation GetIPLocation(string ip) { if (qq == null) { return(new IPLocation()); } else { return(qq.SearchIPLocation(ip)); } }
public static IPLocation GetIPLocation(string ipdatafilepath, string ip_str) { QQWry qq = new QQWry(ipdatafilepath); IPLocation location = new IPLocation(); try { location = qq.SearchIPLocation(ip_str); } catch (Exception ex) { location.country = "未知"; location.area = "未知"; throw ex; } return(location); }