Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private static XmlDocument loadConfigDocument()
- {
- XmlDocument doc = null;
- try
- {
- doc = new XmlDocument();
- doc.Load(getConfigFilePath());
- return doc;
- }
- catch (System.IO.FileNotFoundException e)
- {
- throw new Exception("No configuration file found.", e);
- return null;
- }
- catch (Exception ex)
- {
- return null;
- }
- }
- // retrieve appSettings node
- XmlNode node = doc.SelectSingleNode("//appSettings");
- ExeConfigurationFileMap configMap = new ExeConfigurationFileMap();
- configMap.ExeConfigFilename = @"d:testjustAConfigFile.config.whateverYouLikeExtension";
- Configuration config = ConfigurationManager.OpenMappedExeConfiguration(configMap, ConfigurationUserLevel.None);
Add Comment
Please, Sign In to add comment