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

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

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

11条回答
  •  甜味超标
    2020-11-21 23:25

    You could use a DataSet to read XML strings.

    var xmlString = File.ReadAllText(FILE_PATH);
    var stringReader = new StringReader(xmlString);
    var dsSet = new DataSet();
    dsSet.ReadXml(stringReader);
    

    Posting this for the sake of information.

提交回复
热议问题