xmlnode使用方法 怎么解析xml文件?
怎么解析xml文件?字符串xmlPath=“演示.xml“XmlDocumentuxmldoc=new XmlDocument()XmlDoc.加載(xmlpath)//數組長度string num=
怎么解析xml文件?
字符串xmlPath=“演示.xml“XmlDocumentuxmldoc=new XmlDocument()XmlDoc.加載(xmlpath)//數組長度string num=“”Dictionary<string,string>;xmldata=New Dictionary<string,string>()foreach(xmlnode在u中)XmlDoc.ChildNodes文件){如果(節(jié)點名稱==“num”)num=節(jié)點屬性[“n”]。如果(節(jié)點名稱==“pdr”)xmlData.添加( 節(jié)點屬性[“t”].值節(jié)點屬性[“Q”]。Value)}//此時,您的XML解析已完成。字典存儲PDR數據,num變量存儲數組長度。