winform程序 读、写xml文件

有用到先上代码,后面总结相关知识,,,


创建:

  1. XmlDocumentxmlDoc=newXmlDocument();
  2. //创建类型声明节点
  3. XmlNodenode=xmlDoc.CreateXmlDeclaration("1.0","utf-8","");
  4. xmlDoc.AppendChild(node);
  5. //创建根节点
  6. XmlNoderoot=xmlDoc.CreateElement("User");
  7. xmlDoc.AppendChild(root);
  8. CreateNode(xmlDoc,root,"name","xuwei");
  9. "sex","male");
  10. "age","25");

读取:3种方法

1.XmlDocument

2.XmlTextReader

3.linq to xml

相关文章

php输出xml格式字符串
J2ME Mobile 3D入门教程系列文章之一
XML轻松学习手册
XML入门的常见问题(一)
XML入门的常见问题(三)
XML轻松学习手册(2)XML概念