我有一个多部分下载器,为了让它工作,我正在使用这个 app.config
<?xml version="1.0"?>
<configuration>
<startup><supportedRuntime version="v2.0.50727"/></startup>
<system.net>
<connectionManagement>
<add address="*" maxconnection="65000" />
</connectionManagement>
</system.net>
</configuration>
我如何将该文件放入我的可执行文件或以某种方式在内部设置此参数?
最佳答案
您可以使用:
ServicePointManager.DefaultConnectionLimit = 65000;
http://msdn.microsoft.com/en-us/library/system.net.servicepointmanager.defaultconnectionlimit.aspx
关于c# - MaxConnections 和 App.config 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3577738/