public void SetValue(string key, string value) { XmlElement element = (XmlElement)DOC.SelectSingleNode("Game/" + key); if (element == null) { return; } element.SetAttribute("value", value); DOC.Save(XmlFilePath); }
public void SetValue(string key, string value) { XmlNode xnRoot = DOC.DocumentElement; XmlNodeList xe = xnRoot.ChildNodes; for (int j = 0; j < xe.Count; j++) { XmlElement _1 = xe[j] as XmlElement; if (_1 != null && _1.Attributes["key"].Value == key) { _1.Attributes["value"].Value = value; DOC.Save(XmlFilePath); } } }