1. 程式人生 > >C# 讀取當前文件夾xml

C# 讀取當前文件夾xml

nodes foreach 輸出 XML sel color ldo new file

C# 讀取xml

    //xml -解析
        private void xmldode()
        {
            XmlDocument doc = new XmlDocument();
            String stpa = "XMLFile1.xml";  //解析當前目錄xml文件
            doc.Load(stpa);
            XmlNodeList list = doc.SelectNodes("bookstore/nihao/title");
            foreach (XmlNode node in
list) { oulog(node.Name + ":" + node.InnerText); /*** *輸出為元素+實例 * * **/ } }

C# 讀取當前文件夾xml