码迷,mamicode.com
首页 > 其他好文 > 详细

xml读取

时间:2015-03-20 17:46:23      阅读:109      评论:0      收藏:0      [点我收藏+]

标签:

            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;

 

xml读取

标签:

原文地址:http://www.cnblogs.com/linzhao126/p/4353825.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!