のコレクションを取得するのConfigurationManagerを使用する方法を私持っている私のApp.configファイルに次の私は、次のように私は「サービス」のセクションを取得することができます知っているわからない要素
<?xml version="1.0"?>
<configuration>
<appSettings>
</appSettings>
<services>
<service Site="AAA1.1" Release="QA" Connection="..." Monitor="True"/>
<service Site="AAB1.2" Release="QA" Connection="..." Monitor="True"/>
<service Site="AAC1.2" Release="QA" Connection="..." Monitor="True"/>
<service Site="AAD3.1" Release="QA" Connection="..." Monitor="True"/>
<service Site="AAE3.2" Release="QA" Connection="..." Monitor="True"/>
<service Site="AAF5.1" Release="QA" Connection="..." Monitor="True"/>
<service Site="AAG5.2" Release="QA" Connection="..." Monitor="True"/>
</services>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
</configuration>
:
var section = configuration.GetSection("services");
どのようにすればよいかわからないのは、私がセクションを持っていれば、7つの 'サービス'要素の子コレクションを取得することです。