Is there a way to programmatically get the section names by doing a loop instead of hard coding the names yourself?
For instance:
<configuration>
<configSections>
<section name="Test1" type="System.Configuration.NameValueSectionHandler"/>
<section name="Test2" type="System.Configuration.NameValueSectionHandler"/>
</configSections>
Hardcoding:
var section = ConfigurationManager.GetSection("Test1") as NameValueCollection;
var section = ConfigurationManager.GetSection("Test2") as NameValueCollection;
I do not want to hard code the Test1 and Test2 section names in the code.