public class ConfigReader { IDictionary dict; public LoginConfigReader() { dict = new SortedList(); string myXmlFile = null; myXmlFile = HostingEnvironment.ApplicationPhysicalPath + "App_Data\\myxmlfile.xml"; XmlTextReader reader = new XmlTextReader(myXmlFile); reader.WhitespaceHandling = WhitespaceHandling.None; reader.Read(); // read the config tag reader.Read(); // go to the first tag while ((!reader.EOF)) { if (!reader.IsStartElement()) { break; } dict.Add(reader.Name, reader.ReadElementString); // add the tag as the key and the tag's value as the value } reader.Close(); //close the reader }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)