.net app.config文件中有多个代理
我们有一个客户希望我们放入多个代理以供我们的应用程序使用。我们正在使用一个,并且在.net app.config文件中有多个代理,.net,proxy,app-config,.net,Proxy,App Config,我们有一个客户希望我们放入多个代理以供我们的应用程序使用。我们正在使用一个,并且在app.config文件中有以下设置,所以 <system.net> <defaultProxy> <proxy usesystemdefault="true" proxyaddress="http://their.proxy.address:1234" bypassonlocal="true" /&g
app.config
文件中有以下设置,所以
<system.net>
<defaultProxy>
<proxy
usesystemdefault="true"
proxyaddress="http://their.proxy.address:1234"
bypassonlocal="true"
/>
</defaultProxy>
</system.net>
但随后程序会对代码中的各个类抛出初始化错误
有人能告诉我如何添加多个代理吗?
谢谢。你找到解决办法了吗?@dawncode-no。客户最终只返回到一个代理,因此这对我们来说不是问题。我对这个问题感兴趣。有人知道怎么做吗?你找到解决办法了吗?@dawncode-nope。客户最终只返回到一个代理,因此这对我们来说不是问题。我对这个问题感兴趣。有人知道怎么做吗?
<system.net>
<defaultProxy>
<proxy
usesystemdefault="true"
proxyaddress="http://their-a.proxy.address:1234"
bypassonlocal="true"
/>
<proxy
usesystemdefault="true"
proxyaddress="http://their-b.proxy.address:1234"
bypassonlocal="true"
/>
</defaultProxy>
</system.net>
<system.net>
<defaultProxy>
<proxy
usesystemdefault="true"
proxyaddress="http://their-a.proxy.address:1234"
bypassonlocal="true"
/>
</defaultProxy>
<defaultProxy>
<proxy
usesystemdefault="true"
proxyaddress="http://their-b.proxy.address:1234"
bypassonlocal="true"
/>
</defaultProxy>
</system.net>