示例#1
0
        public string  GetIP()
        {
            string cIP = "";

            try { cIP = IPHelper.GetIPFromDNSPod(); return(cIP); }
            catch { this.NotifyMsg("从DNSPOD获取IP失败"); }

            try { cIP = IPHelper.GetIpFromIp138(); return(cIP); }
            catch { this.NotifyMsg("从IP138获取IP失败"); }

            try { cIP = IPHelper.GetIpFromGreak(); return(cIP); }
            catch { this.NotifyMsg("从GreakIP失败"); }

            throw new Exception("用尽所有备用服务器");
        }
示例#2
0
        public static string GetIpFromGreak()
        {
            string url = "http://greak.net/ip";

            return(IPHelper.GetIpByWeb(url, IPHelper._regGreak, "greak.net"));
        }
示例#3
0
        public static string GetIpFromIp138()
        {
            string url = "http://www.ip138.com/ip2city.asp";

            return(IPHelper.GetIpByWeb(url, IPHelper._regIp138, "ip138"));
        }