How do I read and parse an XML file in C#?

后端 未结 11 2142
庸人自扰
庸人自扰 2020-11-21 23:03

How do I read and parse an XML file in C#?

11条回答
  •  无人共我
    2020-11-21 23:49

    There are lots of way, some:

    • XmlSerializer. use a class with the target schema you want to read - use XmlSerializer to get the data in an Xml loaded into an instance of the class.
    • Linq 2 xml
    • XmlTextReader.
    • XmlDocument
    • XPathDocument (read-only access)

提交回复
热议问题