appSetting "sub-settings"

  • Thread starter Thread starter John Spiegel
  • Start date Start date
J

John Spiegel

Hi all,

I'm looking for suggestions on storing classifications of application
settings in a WinForms app. I've got a couple ideas using XML config files.
One is to have a set of .config files for each classification. For example,
I might have a Documents.config that adds key/values for
application-servicing files.

The other idea, is just an idea. Is it possible to have sub-tags inside
configuration files and still access through the AppSettings collection or
GetConfig method?

Something like

<appSettings>
<CommonFiles>
<add key="AddressLabel" value="MyLabel.doc">
</CommonFiles>
</appSettings>

Is there another, better way to store application-wide settings that would
be better for moderately frequently accessed settings?

TIA,

John
 
You can create custom sections in a config file. To get you started, you
can read about the IConfigurationSectionHandler.
 
Looks good! Thanks, Peter.

Peter Rilling said:
You can create custom sections in a config file. To get you started, you
can read about the IConfigurationSectionHandler.
 
Back
Top