首页 > 编程知识 正文

化学元素,C1

时间:2023-05-03 18:41:35 阅读:116355 作者:1100

代理服务器没有帐户和密码的代理服务器:

//创建请求httpwebrequestrequest=(http webrequest ) WebRequest.create(URL );//一个WebProxy对象webproxy WP=new webproxy (' 102.32.75.24433608088 ); request.Proxy=wp; //超时时间request.Timeout=5000; httpwebresponseresponse=(http webresponse ) request.GetResponse ); streamreader Sr=new streamreader (response.getresponse stream )、encoding.getencoding ) ' gbk ' );//读取网页的string code=sr.ReadToEnd (; 如果代理服务器有帐户和密码

httpwebrequestrequest=(http webrequest ) Webrequest.create ) URL;//一个WebProxy对象WebProxy wp=new WebProxy (; //代理地址WP.address=new uri (102.32.75.24433608088 ); //设置认证凭据帐户密码WP.credentials=newnetworkcredential (' test 123 ',' 123456 ' ); request.Proxy=wp; request.Timeout=5000; httpwebresponseresponse=(http webresponse ) request.GetResponse ); streamreader Sr=new streamreader (response.getresponse stream )、encoding.getencoding ) ' gbk ' );//读取网页的string code=sr.ReadToEnd (; 只做代码分析

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。