How to save settings for a deployed C # application?

I want to save the settings for my application in C #, so that the default settings can be easily sent with my binaries, and the end user can change them using a simple text editor (or some other simple way).
It seems to me that there are several alternatives: a .config file, a .settings file or a .resx file. What are their pros and cons?

Edit1: End users are mostly computer professionals, so editing these files should not be a big problem.

Edit2: settings are something like connection strings and some other parameters (mostly disposable things). Building some kind of GUI / API to change them is actually not an option. Also, my application will not edit any of these values, so code-based saving is not required.

+3
source share
6 answers

, Project + Properties, Settings. , . app.exe.config , EXE. Properties.Settings.Default.SettingName , . .exe.config .

: DLL , .config . app.vshost.exe.config.

.settings , IDE, ..Resx , . .

+4

, .

  • , .
  • , (ini , ..), API.
+1

.settings ( .config , .NET. .config , ).

"" MSDN : http://msdn.microsoft.com/en-us/library/aa730869(VS.80).aspx

+1

, , app.config - . , ? ? , .

XML . , . XSD, , , . , , , , , XML n, n, [ ].

+1

, , , app.config.

, . .INI , . . INI , , .config.

0

. , ClickOnce , , .

I believe that the best way is to create a graphical interface, which is certainly suitable for novice users. Given that you have already excluded this option, use the John clause (ini files).

0
source

Source: https://habr.com/ru/post/1753883/


All Articles