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("用尽所有备用服务器"); }
public static string GetIpFromGreak() { string url = "http://greak.net/ip"; return(IPHelper.GetIpByWeb(url, IPHelper._regGreak, "greak.net")); }
public static string GetIpFromIp138() { string url = "http://www.ip138.com/ip2city.asp"; return(IPHelper.GetIpByWeb(url, IPHelper._regIp138, "ip138")); }