C# 读取与修改xml一个节点的值

XML文件如下:



 
  2014-12-18

C#读取与修改

 string xmlpath = System.AppDomain.CurrentDomain.BaseDirectory + "config.xml";
            XmlDocument doc = new XmlDocument();
            doc.Load(xmlpath);
            XmlNode xn = doc.SelectSingleNode("//transDate");
            string transDate = xn.InnerText;

xn.InnerText = value;
doc.Save(xmlpath);




你可能感兴趣的:(C#,windows,ASP.NET,C#)