Updating app config c
The framework does not include this ability for a reason.
If you want your application's users to not require administrative rights then it is always a better idea to store settings in the user's documents & settings directory or in the registry if needed.
If different users login and use your application, each user can maintain their own separate and unique values making them perfect for user specific preferences. scoped values will be saved in a completely new user.config file.
This is actually clever and ensures that each version of your application does not clash or overwrite values from a previous version.
We used to save our application or user settings in an INI file (dark ages) or more recently in XML files using our own code or classes borrowed from other developers. NET framework using Visual Studio can take advantage of built-in tools to simplify or speed up access and saving of runtime values. C# code uses a slightly different syntax the concepts are similar.
Once common example is saving database connection string information in a configuration file so that it may be changed without need to recompile the application. The following examples are using Visual Studio 2008 and VB. The Basics Each value you want to use in your application is defined as simple name=value pairs and saved in special XML files.
The .config files in the output folders are copies that can be distributed with your EXE in the same folder.
Summary While far from perfect and a bit overly complicated, Visual Studio and the .
NET framework offer an a quick and easy option for storing and accessing data for your application. For example, you can add customized settings files to your project for management of settings in different groups.
For each value you will choose the data type, scope and a default value.
These values will be saved in a file named app.config in your project folder and in a file named .config in output folders after builds such as \bin\Debug\ if building in debug mode.