MaxConnections and App.config question

杀马特。学长 韩版系。学妹 提交于 2019-12-06 07:33:14

问题


I have a multipart downloader, and to get it working I'm using this 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>

How can I put that file into my executable or somehow set this param internally?


回答1:


You can use:

ServicePointManager.DefaultConnectionLimit = 65000;

http://msdn.microsoft.com/en-us/library/system.net.servicepointmanager.defaultconnectionlimit.aspx



来源:https://stackoverflow.com/questions/3577738/maxconnections-and-app-config-question

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!