Saving XML Data in UserSettings

I am trying to save some XML data in my UserSettings (Properties.Settings.Default.UserSettings) in a .NET Winforms project. Is there any way to do this, or would it be better to save this data in a separate file?

Thank you for your responses!

+3
source share
3 answers

You can save the string representation of an XML document in a setting of type String. To save the document, load it into an XmlDocument and set the parameter to the XmlDocument.OuterXml property. To get it, create a new XmlDocument and use its LoadXml method to parse the string in the XML document.

. , - - XML- XML - . , UserSettings, . , . , , , .

, , . , . .

+4

, xml .

xml , .

, .

+1

Thank you for your responses. As a conclusion, I decided to extract this material into another xml file, which I store in resources.

0
source

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


All Articles