xml.WriteStartDocument">

生成xml文档的函数代码

80酷酷网    80kuku.com

  xml|函数|生成xmlprivate void CreateXml()
  {
   XmlTextWriter xml = new XmlTextWriter( "e:\\aaa.xml",Encoding.UTF8 );
   xml.WriteStartDocument();
   xml.WriteStartElement( "xml" );
   xml.WriteStartElement( "aaaa" );
   xml.WriteStartElement("menu");
   xml.WriteAttributeString( "a","<>&b" );
   xml.WriteEndElement(); 
   xml.WriteEndElement();
   xml.WriteEndElement();
   xml.WriteEndDocument();
   xml.Close();
  } 


分享到
  • 微信分享
  • 新浪微博
  • QQ好友
  • QQ空间
点击: