What is the best way to save and load in my program?

I have a C # program.

I need to save my program settings, and I need to load them when the program loads

(I know to do this with a simple text file .... but I don't have good documentation on the variable)

What is the best way to do this?

Can i get a sample?

+3
source share
4 answers

Use appSettings (MSDN link here is a more quick overview ).

+6
source

, , . , , , , :

Properties.Settings.Default.SettingName = "Test Value";
Properties.Settings.Default.Save();

:

textBox.Text = Properties.Settings.Default.SettingName;
+6

, appSettings , , , , . ,

Duplicate

#

, MSDN ( #) , , jasonh .

For a deeper coverage of these topics (assuming you are using Windows Forms or WPF with Visual Studio), I would recommend looking at the Application Settings for Windows Forms .

+6
source

How to save settings in XML?

Reading and writing them is pretty easy .

0
source

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


All Articles