XmlDocument doc = new XmlDocument();
doc.LoadXml("<book genre='novel' ISBN='1-861001-57-5'>" +
"<title>Pride And Prejudice</title>" +
"</book>");
//Create an XML declaration.
XmlDeclaration xmldecl;
xmldecl = doc.CreateXmlDeclaration("1.0","gb2312",null);
//Add the new node to the document.
XmlElement root = doc.DocumentElement;
doc.InsertBefore(xmldecl, root);
doc.Save(@"c:/xx.xml");
ContentType="text/html" ResponseEncoding="gb2312"
asp.net生成xml
最新推荐文章于 2024-07-09 23:44:56 发布