Answer the question
In order to leave comments, you need to log in
Where and how to store program settings correctly?
Program in C# (but in principle this is not so important), before that I used the standard app.config, it was quickly convenient, but its capabilities were not enough. Firstly, there are a lot of parameters: saving the states of all windows, some controls, settings of the program itself, settings for connecting to the server that need to be encrypted, and so on. In general, I decided to write my bike, now I'm thinking where to store it all, and, accordingly, how to implement it.
At the moment I am inclined to create my own settings class and its binary serialization, but the question is, where to store it? I would not want to keep it in the folder with the program, and for each user to have separate settings.
Answer the question
In order to leave comments, you need to log in
The biggest stupidity of a developer is to store settings in the same folder with the program.
msdn.microsoft.com/en-us/library/system.environment.specialfolder.aspx
Store settings either here Environment.SpecialFolder.ApplicationData or here Environment.SpecialFolder.LocalApplicationData
Equivalents in the usual form like:
c:\Users\\AppData\ Roaming\ and
c:\Users\\AppData\Local\
And SettingsBase than does not approach? You can save both for users and for the entire program as a whole.
And what prevents you from writing your own serializable classes for storing settings and adding them to the same app.config? IMHO, it's not worth reinventing your own bicycles in such things, it's better to use standard tools. And then it will turn out as always: they wrote programs that constantly write something in Program Files, they came to the seven - but it doesn’t work there. Are you sure that in Windows-eight, for example, the data will be stored in the same place and in the same way as in the seven?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question