using System.Xml; using System.Xml.Linq; XmlDocument document = new XmlDocument(); document.Load("SessionDef.xml"); XmlNodeList nodelist = document.SelectSingleNode("SessionGroup").ChildNodes; foreach (XmlNode node in nodelist) { string s1=node.Name; }
代码操作的xml文件是 SessionDef.xml
原文:http://www.cnblogs.com/lthxk-yl/p/3732277.html