A
A
Agent_Smith2011-08-03 11:41:41
.NET
Agent_Smith, 2011-08-03 11:41:41

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

7 answer(s)
A
Anatoly, 2011-08-03
@Agent_Smith

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\

A
Alexander, 2011-08-03
@ncix

registry?

S
sajgak, 2011-08-03
@sajgak

SQLlite?

M
MaxFX, 2011-08-03
@MaxFX

I can recommend Isolated Storage for state storage

D
Dmitry, 2011-08-03
@evlntnt

And SettingsBase than does not approach? You can save both for users and for the entire program as a whole.

A
Alexey Grichenko, 2011-08-03
@Kalobok

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?

C
ComputerPers, 2011-08-03
@ComputerPers

Right now I'll dial =)
INI - no?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question