Question

In my applications there are some setting saved in the Properties.Settings.Default. These settings can be changed by the user(s) and needs to be saved locally on the computer. While I can save these setting, the problem is that it is only saved for the user currently logged in. Once an user changes a setting it has to be for all users of the computer. How can I accomplish this?

Was it helpful?

Solution

User scoped settings are just that, settings that an individual user can change and will only be saved for that user.

The application scoped settings will affect all users but they are not designed to be changed by a user.

You might want to consider a different approach to storing settings that you want users to be able to change but to affect all users of an application e.g. the Windows registry or an external xml file.

Another option is to use user scoped settings but to change the location to a centralised location so that all users use/save the same settings. See Store user settings into application folder for an option on how to do this.

OTHER TIPS

When you open the Settings Designer window in Visual Studio, you have four values that you need to enter for each setting:

enter image description here

You need to set the Scope property to Application to have a setting that is the same for all users. For the full story, read the Using Application Settings and User Settings page on MSDN.

Application settings cannot be changed, only by hand before the application is run so I do not recommend that approach.

In my opinion, propagating the changes may be generally a bad approach. Since this config (user.config) is generally stored in the user's own folder (under Users), it should not be modified by another user (in fact, without administrator acces, another user cannot even access).

I might recommend using other places to store application specific settings: xml or config file near your application, or maybe the registry.

I would use an external Database for that Stuff... But if you want it quick and simple just save it to a File on the Harddrive (for example C:\Program_Data\\settings.csv) i would use a csv file because it's not much work...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top