Another Config Question

  • Thread starter Thread starter GitStudent
  • Start date Start date
G

GitStudent

C++ Programmer making the switch to C#, and learning as I go. Here's
what I'm looking for.

I want to have a config file with a section Group and that group have
several elements in it.

I want to read the members of those groups into an array or hash
table. I would prefer to do it in the manner of...

for(int I = 0;I < groupcount; I++)
{
array = ConfigurationSettings ; This is where I would walk
through the section elements
}

Can I do that?

If so.... How?


Config example

<sectionGroup name="MyGroup">
<section name="Element1"
type="System.Configuration.NameValueSectionHandler"/>
<section name="Element2"
type="System.Configuration.NameValueSectionHandler"/>
</sectionGroup>
 
There is a whole XML namespace dedicated to reading and parsing XML
documents.
You can do it in loops but depending on the structure of your files,
you may also need to consider using recursion.
 
Back
Top