If you want to write to the config file from your application you cannot use
the app.config file.
I reckon the best and most flexible solution is XML Serialization. Moreover,
it has advantages towards flat <appSettings> element and it's subelements.
Using XML Serialization you can desing your own class with all application
settings you need and simply serialize/deserialize it into/from a file.
You gain read/write settings capabilities and more complex settings
structure including even arrays and nested elements.
You can go as far as:
<Settings>
<Section1>
<OptionName value="123" output="098324-2" />
<OptionName value="kljewr" output="098324-2" />
<OptionName value="-93mc[" output="098324-2" />
<OptionName value="[apioewcr" output="098324-2" />
</Section1>
<Section2>
<OptionName value="123" output="098324-2" />
<OptionName value="kljewr" output="098324-2" />
<OptionName value="-93mc[" output="098324-2" />
<OptionName value="[apioewcr" output="098324-2" />
</Section2>
...
</Settings>
--
Cezary Nolewajka
mailto:c.*********************@no-sp-am-eh-mail.com
remove all "no-sp-am-eh"s to reply
"Jimbo" <None> wrote in message
news:Oh****************@TK2MSFTNGP10.phx.gbl...
What's the best format to save a configuration file?
I'm currently using an INI extension and I write it like a normal ascii
file. Is this the best way? I've heard of using XML to create a config
file. What would be the best format?
Thank you.