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

2022-10-22,,,,

复制代码 代码如下:
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();

《c#中带头(声明)的xml(封装)生成.doc》

下载本文的Word格式文档,以方便收藏与打印。