5

I want to read following custom section from app.config:

<StartupFolders>    
   <Folders name="a">
      <add folderType="Inst" path="c:\foo" />
      <add folderType="Prof" path="C:\foo1" />      
   </Folders>
   <Folders name="b">
      <add folderType="Inst" path="c:\foo" />
      <add folderType="Prof" path="C:\foo1" />      
   </Folders> 
</StartupFolders>

I found this link, but it does not say for multiple <Folders> tag. Please help?

tshepang
  • 12,111
  • 21
  • 91
  • 136
Hemant Kothiyal
  • 4,092
  • 19
  • 61
  • 80
  • 1
    Please post you code and explain how it does not work for you. As it stands, this is a very poor quality question and should be closed. – Lazarus Dec 27 '11 at 10:19
  • 1
    Did you check out some of the links I posted in my answer to your earlier question?? http://stackoverflow.com/questions/8642247/how-can-we-write-our-own-configuration-in-app-config Those links would explain how to write a custom config section and how to read and use it, too – marc_s Dec 27 '11 at 10:44

1 Answers1

2

Hi You can Access custom sections like this

CustomConfigClass section = (CustomConfigClass)ConfigurationManager.GetSection("StartupFolders");

Hope it helps you.

JayOnDotNet
  • 398
  • 1
  • 5
  • 17