如:
 <configSections >
    <sectionGroup name="Example1">
      <section name="TableName" type="System.Configuration.SingleTagSectionHandler"/>
    </sectionGroup>
    <sectionGroup name="Example2">
      <section name="TableName" type="System.Configuration.SingleTagSectionHandler"/>
    </sectionGroup>
   <sectionGroup name="Example3">
      <section name="TableName" type="System.Configuration.SingleTagSectionHandler"/>
    </sectionGroup>  </configSections>我怎么知道他有三个组,并且访问每个组的名字?

解决方案 »

  1.   

    ConfigurationSectionGroupCollection 
        groups = config.SectionGroups;
    Console.WriteLine("Groups: {0}",
        groups.Count.ToString());
      

  2.   

    in .NET 2.0, look into System.Configuration.ConfigurationManager (winform) and System.Web.Configuration.WebConfigurationManager (webform)
      

  3.   

    onfigurationSectionGroupCollection 
        groups = config.SectionGroups;
    Console.WriteLine("Groups: {0}",
        groups.Count.ToString());这个统计的是一个节组里的节有多少个,但是我要统计的是有多少个节组啊
      

  4.   

    原来是把machine.config里的一起读了,我怎么样才能只读我自己建的呢?