c#中带头(声明)的xml(封装)生成
来源:不详 责任编辑:admin 发表时间:2013-07-01 20:33 点击:次
复制代码 代码如下:
XmlDocument downLoadFilexml = new XmlDocument();
XmlElement root = null;
XmlElement kisokChild = null;
//生成xml的头
XmlNode xmlnode= downLoadFilexml.CreateXmlDeclaration("1.0", "utf-8", null);
downLoadFilexml.AppendChild(xmlnode);
root = downLoadFilexml.CreateElement("test");
root.SetAttribute("Guid",“1”);
root.SetAttribute("BuildID","0");
downLoadFilexml.AppendChild(root);
kisokChild = downLoadFilexml.CreateElement("testChild");
kisokChild.SetAttribute("Interval","111");
root.AppendChild(kisokChild);
Response.Write(downLoadFilexml.OuterXml);
Response.End();
相关新闻>>
最新推荐更多>>>
- 发表评论
-
- 最新评论 进入详细评论页>>
今日头条
更多>>您可能感兴趣的文章
- Asp.net MVC源码分析--Model Validation(Client端)实现(2)
- 教你如何来恢复一个丢失的数据文件
- 谈.Net委托与线程——创建无阻塞的异步调用(一
- asp.net 六大内置对象(2)
- ASP.NET数据格式的Format--DataFormatString
- Pro ASP.NET MVC 3 Framework学习笔记之九
- 微软ASP.NET站点部署指南(11):部署SQL Server数据
- winform下通过webclient使用非流方式上传(post)数据和
- asp.net js模拟Button点击事件
- MVC中一个表单实现多个提交按钮(一个action搞定