. appSettings , .. "key1", "key2" .., , , . , .. "1; 2; value3;..".
. , - web.config. web.config .
<configuration>
<configSections>
<sectionGroup name="MySectionGroup">
<section name="MySection" type="[type and full assembly name]"/>
...
<MySectionGroup>
<MySection>
[some xml]
Next, create a section handler class; it needs to implement the IConfigurationSectionHandler interface, which defines the Create method. Create takes sectionNode as a parameter, which is an XML node that you can parse as you want. The return object must contain the data that you analyzed. To load the section handler, write:
MySectionDataObject myData = ConfigurationManager.GetSection( "MySectionGroup/Section" ) as MySectionDataObject
source
share