this.SetCertificatePolicy(); httpItem = new HttpItem(); httpItem.Method = "GET"; httpItem.URL = "这里填写你要获取IP的网址路径"; httpItem.ReadWriteTimeout = 1500; httpItem.Timeout = 1500; httpItem.UserAgent = "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.25 Safari/537.36 Core/1.70.3676.400 QQBrowser/10.5.3738.400"; string html = new Tu_MyHttp().SeedHttpItem(httpItem).Html; this.ip = html.GetBetween_K("您现在的 IP:", "</code>").GetRight_K("<code>", false).Trim(); bool flag3 = this.IsIP(this.ip); if (flag3) { break; }