XmlDocument xDoc = new XmlDocument(); try { // load the configuration file xDoc.Load(sFileName); // find the node of interest from the key XmlNode theNode = xDoc.SelectSingleNode(@"/thingy/appSettings/add[@key = '" + key + "\']"); // retrieve the nodes value if it exists if (theNode != null) return theNode.Attributes["value"].Value; }
No comments:
Post a Comment