The .NET 2.0 and up configuration system is quite powerful and extensible - as long as you don\'t want to change the fact it all comes from XML files in the filesystem.
You can try Cinchoo framework for your needs.
It supports reading and writing configuration entries to File, Registry, INI, Database etc.
Here is the simple way to define and use the configuration object using Cinchoo framework
namespace HelloWorld
{
#region NameSpaces
using System;
using Cinchoo.Core.Configuration;
#endregion NameSpaces
[ChoConfigurationSection("sample")]
public class SampleConfigSection : ChoConfigurableObject
{
[ChoPropertyInfo("name", DefaultValue="Mark")]
public string Name;
[ChoPropertyInfo("message", DefaultValue="Hello World!")]
public string Message;
}
static void Main(string[] args)
{
SampleConfigSection sampleConfigSection = new SampleConfigSection();
Console.WriteLine(sampleConfigSection.ToString());
}
}
Very first time, when you run the application, Cinchoo framework automatically generates the configuration section as below. Then onwards, you can control them either through configuration source or by code.
Try it!