尝试过使用代理软件和使用IE代理,但都不成功,最终使用配置的方式
第一在HttpWebRequest 中设置Proxy 属性为 DefaultWebProxy,或者不设置。
第二在web.config 中的 configuration 根节点增加 ,可以在bypasslist中增加不走代理的正则
<system.net>
<defaultProxy enabled="True" useDefaultCredentials="True">
<proxy proxyaddress="http://172.16.100.187:8888"
bypassonlocal="True" />
<bypasslist>
<add address="[a-z]*[\.]*baidu\.com" />
<add address="192\.168\.\d{1,3}\.\d{1,3}" />
<add address="172\.16\.\d{1,3}\.\d{1,3}" />
</bypasslist>
</defaultProxy>
</system.net>
本文介绍了一种通过在web.config文件中配置代理的方式实现特定网址访问的方法。主要通过启用默认代理并指定代理服务器地址来实现全局代理,并通过bypasslist设置本地及特定网址不使用代理。
1305

被折叠的 条评论
为什么被折叠?



