Trying to loop through app.config file, searched the posts but haven't had luck
app.config
<configSections>
<section name="US" type="System.Configuration.NameValueSectionHandler"/>
<section name="UK" type="System.Configuration.NameValueSectionHandler"/>
</configSections>
<US>
<add key="UserName" value="test" />
<add key="Password" value="test" />
<add key="baseURI" value="http://test.com />
<add key="ClientSettingsProvider.ServiceUri" value="" />
</US>
<UK>
<add key="UserName" value="test1 />
<add key="Password" value="test1 />
<add key="baseURI" value="http://test1.com />
<add key="ClientSettingsProvider.ServiceUri" value="" />
</UK>
I need to loop through app.config file and get the key value data like the below for US and UK sections.
*Result:*
Section : US
Username: test
Password: test
baseURI: http://test.com
Section : UK
Username: test1
Password: test1
baseURI: http://test1.com