C Sharp中使用HTTP的代码

雷亚荣

关注

阅读 111

2022-10-12

在云中,可以加入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)

0 0 举报