草庐IT

XmlNodeReader

全部标签

c# - 如何在 C# 中读取 XML 文档对象?

在可视化C#项目中,我想将XML文档对象传递给方法。在那个方法中,我应该读取存储在XML文档对象中的值。无需创建XML文件。感谢大家的回复,我终于得到了我的代码。//usefollowingcodewhenassignvaluestoXMlDocumentXMLOBJECT(){XmlDocumentxmlEmployee=newXmlDocument();XmlElementxmlRoot=xmlEmployee.CreateElement("HR");XmlElementxmlEmployees=xmlEmployee.CreateElement("Employee");xmlEm