Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="utf-8"?>
- <configuration>
- <configSections>
- <sectionGroup name="ConsoleSettings">
- <section name="Console" type="MyApp.ConfigSection" allowLocation="true" allowDefinition="Everywhere" />
- </sectionGroup>
- </configSections>
- <ConsoleSettings>
- <Console Username="User" Password="user" LanAddress="192.168.42.11" Port="8792" />
- </ConsoleSettings>
- ....
- var configFile = new ExeConfigurationFileMap();
- var configFile.ExeConfigFilename = "MyApp.exe.config";
- var config = ConfigurationManager.OpenMappedExeConfiguration(configFile, ConfigurationUserLevel.None);
- var configGroup = config.SectionGroups[@"ConsoleSettings"];
- var consoleSection = configGroup.Sections[0];
- var lanAddress = consoleSection.// this is where I get stuck
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement