Метод ServicePointManager.FindServicePoint(...)
поможет вам получить объект ServicePoint
, указанный вами в файле конфигурации.
Допустим, это ваш файл конфигурации:
<configuration>
<system.net>
<connectionManagement>
<add address="http://www.contoso.com" maxconnection="2" />
<add address="192.168.1.2" maxconnection="4" />
<add address="*" maxconnection="1" />
</connectionManagement>
</system.net>
</configuration>
Этот код будет получать "http://www.microsoft.com" ServicePoint
:
ServicePoint sp1 = ServicePointManager.FindServicePoint(new Uri("http://www.microsoft.com"));
Вы можете прочитать все об этом здесь .