Xml个人体会

  Xml写入方法有2种:

 

  1.创建XmlDoucument对象。

  2.Load ()对象对象加载Xml文件

  3.加载声明段落  xmldoc.CreateXmlDeclaration("1.0""gb2312"null);  

  4. 创建根元素. xmldoc.CreateElement("""Employees""");  

   5.加入另外的元素    CreateXmlNode ();

   6.设置节点的属性   xe1.SetAttribute("genre""李赞红");//设置该节点 genre属性  

   7. 添加到<Employees>节点中  root.AppendChild(xe1);

posted @ 2010-07-31 12:52  yinbo.crazy  阅读(144)  评论(0编辑  收藏  举报