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?
Use appSettings (MSDN link here is a more quick overview ).
, , . , , , , :
Properties.Settings.Default.SettingName = "Test Value"; Properties.Settings.Default.Save();
:
textBox.Text = Properties.Settings.Default.SettingName;
, appSettings , , , , . ,
appSettings
#
, 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 .
How to save settings in XML?
Reading and writing them is pretty easy .
Source: https://habr.com/ru/post/1712491/More articles:Creating an installation (MSI) to register (regasm) an assembly - c #Problem with reflection in Unit / Integration tests - reflectionProgrammatically determine if a given VOB is installed in ClearCase - clearcaseICEFaces actions against actionListener - javawcf Service Known attribute type attribute - wcfКак я могу ударить встроенное изображение 1px, но не остальную часть строки? - htmlSecurity Recommendations for Web Applications - securityHow to model one-to-one relationships in Django - pythonDoes anyone know a system like CMS Asp.Net C # with a form module - c #spring beanpostprocessor not working on component scan? - javaAll Articles