摘要: 这里我们先介绍操作XML文件的两个对象:XmlTextReader和XmlTextWriter打开和读取Xml文件使用到的对象就是XmlTextReader对象。下面的例子打开了与程序在同一路径下的一个例子文件sample.xmlprivate static string _Store = Loca... 阅读全文
posted @ 2015-11-24 13:11 天马3798 阅读(876) 评论(0) 推荐(1) 编辑
摘要: private static string _Store = LocalPathHelper.CurrentSolutionPath + "/data/bookstore.xml";1.添加节点/// /// 向根节点中插入一个节点/// public static void AddOne... 阅读全文
posted @ 2015-11-24 11:44 天马3798 阅读(3082) 评论(0) 推荐(0) 编辑
摘要: XmlDocument加载xml方法 XmlDocument doc = new XmlDocument(); //加载xml 字符串 doc.LoadXml(_Store); //加载xml文件 doc.Load(_Store);//如果LoadXml指定的是文件地址,抛出异常,根级别的数据无效 阅读全文
posted @ 2015-11-24 11:27 天马3798 阅读(2210) 评论(0) 推荐(0) 编辑