当前位置: 移动技术网 > IT编程>开发语言>.net > c#中带头(声明)的xml(封装)生成

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

2017年12月12日  | 移动技术网IT编程  | 我要评论

打工行伴奏,海南天涯海角,青年视觉电子杂志

复制代码 代码如下:

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();

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网