1 xmlDocument = new XmlDocument(); 2 xmlDocument.Load(xmlPath); 3 nsmgr = new XmlNamespaceManager(xmlDocument.NameTable); 4 XmlNode xmlNode = xmlDocument.SelectSingleNode(@"/AppItems/AppItem[@key=‘" + nodeName + "‘]", nsmgr); 5 XmlElement Xe = (XmlElement)xmlNode; 6 Xe.SetAttribute("value", nodeText); 7 xmlDocument.Save(xmlPath);
XML 根据key值来修改value的值