xml读取

            XmlDocument xd = new XmlDocument();
            XmlReaderSettings settings = new XmlReaderSettings();
            settings.IgnoreComments = true;//忽略注视12121
            XmlReader xReader = XmlReader.Create(filepath, settings);
            xd.Load(xReader);
            XmlNode root = xd.DocumentElement;
            XmlNodeList nodeList = root.ChildNodes;
            XmlNodeList portrait_nodelist = root.SelectNodes("/picture/portrait");
            string head = portrait_nodelist.Item(0).Attributes["originaldir"].Value;

 

posted @ 2015-03-20 15:48  linzhao  阅读(200)  评论(0编辑  收藏  举报