首页 新闻 会员 周边 捐助

程序中如何通过代理服务器访问

0
[已解决问题] 解决于 2008-01-27 00:38
程序中通过webclient来获取web页面内容: &nbsp; <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Dim &nbsp; MyClient &nbsp; As &nbsp; New &nbsp; System.Net.WebClient <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Dim &nbsp; Urlstr &nbsp; As &nbsp; String="http://www.sina.com.cn" &nbsp; &nbsp; '页面地址 <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Dim &nbsp; response &nbsp; As &nbsp; System.IO.Stream <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Dim &nbsp; SrReadToEnd &nbsp; As &nbsp; System.IO.StreamReader <BR>&nbsp; <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; response &nbsp; = &nbsp; MyClient.OpenRead(Urlstr) <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SrReadToEnd &nbsp; = &nbsp; New &nbsp; System.IO.StreamReader(response, &nbsp; System.Text.Encoding.Default) <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; While &nbsp; SrReadToEnd.Peek &nbsp; &lt;&gt; &nbsp; -1 <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; '遍历网页内容 <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; End &nbsp; While <BR>现在如果要通过代理服务器访问的话,该怎么搞?感谢各位大侠指教!
cloudgamer的主页 cloudgamer | 菜鸟二级 | 园豆:280
提问于:2008-01-26 17:48
< >
分享
最佳答案
0
用WebResponse可以支持代理。WebClient是缩水的不支持代理
zeus2 | 初学一级 |园豆:92 | 2008-01-26 22:08
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册