View Code
public bool IsBeiJingIPAddress() { string clientIP = GetClientIP(); string val = CS.Utility.Strfunc.GetHtml(string.Format("http://www.youdao.com/smartresult-xml/search.s?type=ip&q={0}", clientIP)); val = val.Replace("\0", ""); CS.Utility.Log.LogHelper.Log.WriteLog("youdao:" + val); if (string.IsNullOrEmpty(val)) { val = CS.Utility.Strfunc.GetHtml(string.Format("http://www.ip138.com/ips1388.asp?ip={0}&action=2", clientIP)); val = val.Replace("\0", ""); CS.Utility.Log.LogHelper.Log.WriteLog("ip138:" + val); } if (string.IsNullOrEmpty(val)) { val = CS.Utility.Strfunc.GetHtml(string.Format("http://api.liqwei.com/location/?ip={0}", clientIP)); val = val.Replace("\0", ""); CS.Utility.Log.LogHelper.Log.WriteLog("liqwei:" + val); } if (val.Contains("北京")) { return true; } else { return false; } }