<?xml version="1.0" encoding="utf-8" ?> <configuration> <configSections> <section name="SimpleConfiguration" type="MySectionHandler,MyAssembly"> </section> </configSections> <SimpleConfiguration> <Module1> <section1> <key1>value1</key1> <key2>value2</key2> </section1> </Module1> <Module2> <section1> <key1>value1</key1> <key2>value2</key2> <section1> </Module2> </SimpleConfiguration>
ArrayList modules = (ArrayList)System.Configuration.ConfigurationSettings. GetConfig("SimpleConfiguration");
public class MySectionHandler : IConfigurationSectionHandler { public object Create(object parent, object configContext, XmlNode section) { ... Read your xmlnode section ... return an ArrayList } // end of method } // end of class
string value = AppServices.getValue( "/SimpleConfiguration/Module1/section1/key1");