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

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

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

11条回答
  •  情话喂你
    2020-11-21 23:48

    If you want to retrive a particular value from an XML file

     XmlDocument _LocalInfo_Xml = new XmlDocument();
                _LocalInfo_Xml.Load(fileName);
                XmlElement _XmlElement;
                _XmlElement = _LocalInfo_Xml.GetElementsByTagName("UserId")[0] as XmlElement;
                string Value = _XmlElement.InnerText;
    

提交回复
热议问题