源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

c#中带头(声明)的xml(封装)生成

  • 时间:2021-11-26 19:01 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:c#中带头(声明)的xml(封装)生成
[u]复制代码[/u] 代码如下:
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();
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部