app.config and web.config are very powerfull techniques for managing application settings. For more information about using configuration file please check this article in MSDN
But the manipulation of these files has 2 issues
1) There’s no class in .NET framework to update the files so you have to write your own code to access the configuration file as any xml file and update it
For those two reasons, I developed a very simple assembly called simpleConfiguration which has 1 class called AppSettings and this AppSettings class has an indexer to get/set the values of the configuration settings. And this library is thread-safe.
To read from your app.config file just use these two lines
C#
simpleConfiguration.AppSettings settings=new simpleConfiguration.AppSettings();
string myValue=settings[“myValuekey”];
VB
Dim settings As New simpleConfiguration.AppSettings
Dim name As String = settings.Item("myValuekey ")
To write to app.config
settings[“myValuekey”]=”myValue”;
Settings.Item(“myValuekey”)=”myValue
To download the assembly go here and to download the source files here