首页 > Windows开发 > 详细

C#NET获取IP地址的方法

时间:2020-03-04 21:47:20      阅读:64      评论:0      收藏:0      [点我收藏+]
                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;
                }

 

C#NET获取IP地址的方法

原文:https://www.cnblogs.com/wz2988/p/12416376.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!