ASP.NET实现根据IP获取省市地址的方法

2019-05-23 07:25:43于丽

                        break;
                    }if (ip_Int >this.startIp)
                        rangB = recNO;
                    else
                        rangE = recNO;
                }this.GetStartIp(rangB);
                this.GetEndIp();
                if (this.startIp <= ip_Int &&this.endIp >= ip_Int)
                {
                    this.GetCountry();
                    this.local =this.local.Replace("(我们一定要解放台湾!!!)", "");
                }else{
                    nRet =3;
                    this.country ="未知";
                    this.local ="";
                }
                objfs.Close();
                return nRet;
            }catch{
                return1;
            }
        }// IP地址转换成Int数据#region IP地址转换成Int数据 privatelong IpToInt(string ip)
        {
            char[] dot =newchar[] { '.' };
            string[] ipArr = ip.Split(dot);