0
点赞
收藏
分享

微信扫一扫

C Sharp中使用HTTP的代码

雷亚荣 2022-10-12 阅读 111

在云中,可以加入HTTP来提高抓取成功概率,以华科HTTP为例:

HttpWebRequest request = (HttpWebRequest)WebRequest.Create("​​http://ip.hahado.cn/ip​​");

WebProxy myProxy = new WebProxy();

Uri newUri = new Uri("​​http://ip.hahado.cn:39010​​");

myProxy.Address = newUri;

myProxy.Credentials = new NetworkCredential("username", "password");


request.Proxy = myProxy;

举报

相关推荐

0 条评论