/// <summary>
/// 修改XML
/// </summary>
/// <param>test</param>
public static void ChangeXml(string str)
{
string xmlPath = "config";//当前文件夹下的config
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(xmlPath);
XmlNodeList settings = xmlDoc.SelectNodes("con/app/user");
foreach (XmlNode node in settings)
{
XmlNode valueNode = node.SelectSingleNode("value");
string[] uri = valueNode.InnerText.Split(‘/‘);
valueNode.InnerText = str;
}
xmlDoc.Save(configPath);
}
原文:http://www.cnblogs.com/anyben/p/4364984.html