Application and user settings in .Net are very simple to take advantage of. But how are they different?
Application settings are stored in the applications config file (XML document). Application settings cannot be changed while the program is running. So if you make a change in the config file while the program is running those changes will not be reflected until you restart the program. As an example, connection strings are a great thing to save here.
User settings are initially stored in the config file. The first time the program gets run it takes the values in the config file and loads them into a memory block for the program. Once you close the program all settings that were changed while the program was running are then saved in this block of memory. You can also call the method My.Settings.Saver() which will save the settings prior to the termination of the program. Great things to save in this are object that the user can manipulate and you want to save that data when they leave the program.
You might not believe me with the user settings but try it out yourself. Create a small project that saves some settings to a user setting. Then open the program in your favorite hex editor. Search for the setting that you saved, you will find it!
Like this:
Like Loading...