winform程序 读、写xml文件

前端之家收集整理的这篇文章主要介绍了winform程序 读、写xml文件前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
@H_301_0@有用到先上代码,后面总结相关知识,,,

@H_301_0@

@H_301_0@创建:

  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");

@H_301_0@读取:3种方法

@H_301_0@1.XmlDocument

@H_301_0@2.XmlTextReader

@H_301_0@3.linq to xml

原文链接:https://www.f2er.com/xml/293722.html

猜你在找的XML相关文章