I would highly, HIGHLY recommend NOT using App.config for user setting.
1) There's only 1 App.Config for an application. If you have multiple users on one system (Shared PCs, Terminal Server/Cytrix) this causes any one person's settings to overwrite the others. This also just happened in my office yestarday. A 3rd party leasing solution uses a settings file i the app folder to determine which environment to log into by default. We realised at 1 in the afternoon that the entire leasing department was logged into the test environment and had wasted half a days work.
2) C:\Program Files\... is often protected. Non-Admins who attempt the run the program will get errors because they do not have sufficient rights to modify the file.
3) App.Config will not roam. If your network has roaming profiles, you can put settings files in the UserSettings folder to have them follow the user from machine to machine.
The way I recommend, is via ADO.Net, XML and the Environment.SpecialFolder.ApplicationData folder.
On loading of the app (ie: under a splash screen) check to see if the XML file exists in Environment.SpecialFolder.ApplicationData. If the file does not exist, create it with default values. Create a dataset, add a data table, add 2 columns to the datatable, a key field and a value field. Add all of the Key-Value pairs you want to the data table. Use the DataSet.WriteXML method to write the data to an XML file in the Environment.SpecialFolder.ApplicationData folder. Then load the XML file. If the user changes any settings, update the data table and use the dataset.writeXML method to update the XML file.
-Rick
VB.Net Forum forum796 forum855 ASP.NET Forum
I believe in killer coding ninja monkeys.![[monkey] [monkey] [monkey]](/data/assets/smilies/monkey.gif)