How do I map XML to C# objects

前端 未结 9 1894
旧巷少年郎
旧巷少年郎 2020-11-27 13:37

I have an XML that I want to load to objects, manipulate those objects (set values, read values) and then save those XMLs back. It is important for me to have the XML in the

9条回答
  •  青春惊慌失措
    2020-11-27 13:49

    Use xsd.exe command line program that comes with visual studio to create class files that you can use in your project/solution, and the System.Xml.Serialization namespace (specifically, the XmlSerializer class) to serialize/deserialze those classes to and from disk.

提交回复
热议问题