Advertisement
Guest User

Untitled

a guest
Jan 16th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. public class MyConfigurationSection : ConfigurationSection
  2. {
  3. [ConfigurationProperty("proxy", DefaultValue = "", IsRequired = false)]
  4. public string HttpProxy
  5. {
  6. get { return (string) this["proxy"]; }
  7. set { this["proxy"] = value; }
  8. }
  9. }
  10.  
  11. <?xml version="1.0" encoding="utf-8" ?>
  12. <configuration>
  13. <configSections>
  14. <section name="liba"
  15. type="LibA.MyConfigurationSection, LibA, Version=1.0.0.0, Culture=neutral"></section>
  16. </configSections>
  17. <liba>
  18. <proxy>abc</proxy>
  19. </liba>
  20. </configuration>
  21.  
  22. MyConfigurationSection myConfiguration = (MyConfigurationSection) ConfigurationManager.GetSection("liba");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement