All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
在ASP.NET,2.0中使用RDLC格式的报表的问题_.net资料_编程技术
ASP.NET中AJAX编程开发指南_[Asp.Net教程]
ajax+php无刷新二级联动下拉菜单
如何用PHP制作静态网站的模板框架_php资料_编程技术
PHP学习:Smarty的分页实现_[PHP教程]
C#中时间格式的转换_[Asp.Net教程]
推荐:ASP.NET虚拟主机安全漏洞解决方案_.net资料_编程技术
asp.net2.0网站基础之创建ASP.NET 2.0网站
在ASP.NET应用程序中捕捉身份验证状态的变化_.net资料_编程技术
visual c++中程序调试之断点跟踪
Reading number is top 10 pictures
A man's favorite things10
2013中国四川省高考作文
China railway shunting skills competition
The real super beauty6
梦幻的风景
男人帮杂志里的惹火性感美女1
Ashlynn Brooke photograph of a group3
Parking technology is great, that give you the keys can't stolen
China telecom 114 spokesman MeiYanXu1
Summer is most suitable for young people to travel in China4
Download software ranking
Eclipse 4.2.2 For Win64
Tram sex maniac 2 (H) rar bag10
Proficient in Eclipse
Tram sex maniac 2 (H) rar bag16
Boxer's Top ten classic battle8
美女写真1
豪门浪荡史
金山office2007
少妇苏霞全本
Tram sex maniac 2 (H) rar bag14
归海一刀 published in(发表于) 2014/1/30 1:20:41 Edit(编辑)
ASP.NET存取XML实例代码与注解_[Asp.Net教程]

ASP.NET存取XML实例代码与注解_[Asp.Net教程]

ASP.NET存取XML实例代码与注解_[Asp.Net教程]
ASP.NET存取XML实例代码:

using System.Xml;
初始化一个xml实例
XmlDocument xml=new XmlDocument();
导入指定xml文件
xml.Load(path);
xml.Load(HttpContext.Current.Server.MapPath(”../7in10.xml”));
指定一个节点
XmlNode root=xml.SelectSingleNode(”/root”);
获取节点下所有直接子节点
XmlNodeList childlist=root.ChildNodes;
判断该节点下是否有子节点
root.HasChildNodes;
获取同名同级节点集合
XmlNodeList nodelist=xml.SelectNodes(”/Root/News”);
生成一个新节点
XmlElement node=xml.CreateElement(”News”);
将节点加到指定节点下,作为其子节点
root.AppendChild(node);
将节点加到指定节点下某个子节点前
root.InsertBefore(node,root.ChildeNodes[i]);
为指定节点的新建属性并赋值
node.SetAttribute(”id”,”11111″);
为指定节点添加子节点
root.AppendChild(node);
获取指定节点的指定属性值
string id=node.Attributes["id"].Value;
获取指定节点中的文本
string content=node.InnerText;
保存XML文件
xml.Save(path);
xml.Save(HttpContext.Current.Server.MapPath(”../7in10.xml”));


添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.