c# 创建,加载,修改XML文档

  using System.Xml.Linq;
static void Main(string[] args) { XDocument xDocument = new XDocument(new XElement("mployess", //创建跟元素 new XElement("name", "a"),new XElement("name","b")));//创建元素 xDocument.Save("地址"); XDocument empole = XDocument.Load("地址");//加载xml 文档 可以保证修改 Console.WriteLine(empole); }
原文地址:https://www.cnblogs.com/feizianquan/p/10123245.html