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