Re: Best format for configuration file?
From: Cezary Nolewajka (c.nolewajka-no-sp-am-eh_at_no-sp-am-eh-mail.com)
Date: 02/06/04
- Next message: Ken Onweller \(.NET MCSD\): "Re: My document path"
- Previous message: John Eikanger: "RE: Child WebParts in SPS 2003"
- In reply to: Jimbo: "Best format for configuration file?"
- Next in thread: UAError: "Re: Best format for configuration file?"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 6 Feb 2004 17:29:12 +0100
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.nolewajka-no-sp-am-eh@no-sp-am-eh-mail.com remove all "no-sp-am-eh"s to reply "Jimbo" <None> wrote in message news:OhO0%23YL7DHA.1852@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. > >
- Next message: Ken Onweller \(.NET MCSD\): "Re: My document path"
- Previous message: John Eikanger: "RE: Child WebParts in SPS 2003"
- In reply to: Jimbo: "Best format for configuration file?"
- Next in thread: UAError: "Re: Best format for configuration file?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|