/// <summary> /// 根据IP获取ip库记录实体 /// </summary> /// <param name="strIPAddr">ip地址</param> /// <returns>ip库记录实体</returns> public SysIPInfo Get_CityByIP(string strIPAddr) { SysIPInfo ipinfo = null; long ipnum = Get_IPNum(strIPAddr); int cityid = 0; IList <SysIPInfo> entitys = MyBLL.GetSysIPs(ipnum); if (entitys != null) { ipinfo = entitys[0]; } return(ipinfo); }
/// <summary> /// 根据IP获取ip库记录实体 /// </summary> /// <returns>ip库记录实体</returns> public SysIPInfo Get_CityByIP() { SysIPInfo ipinfo = new SysIPInfo(); long ipnum = Get_IPNum(); int cityid = 0; IList <SysIPInfo> entitys = MyBLL.GetSysIPs(ipnum); if (entitys != null) { ipinfo = entitys[0]; } if (ipinfo.CityID == 0) { ipinfo.CityID = 1; } if (ipinfo.ProvinceID == 1) { ipinfo.ProvinceID = 1; } return(ipinfo); }