appSetting "sub-settings"

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
 
P

Peter Rilling

You can create custom sections in a config file. To get you started, you
can read about the IConfigurationSectionHandler.
 
J

John Spiegel

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top