简单粗暴,直接上代码:
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(Help.basePath);
XmlNode root = xmlDoc.SelectSingleNode("//cusBanNetList");
XmlElement timelock = xmlDoc.CreateElement("BanNetList");
timelock.InnerText = txtBanNetworkUrl.Text;
root.AppendChild(timelock);
xmlDoc.Save(Help.basePath);
Help.basePath------------文件路径
cusBanNetList----------节点名
txtBanNetworkUrl.Text---------------节点值
C# winform 在xml文件中根据指定节点名查找节点名以及值
原文地址:http://blog.csdn.net/u014180504/article/details/44834893