<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <appSettings>
<db1>
    <add key="fdir" value="software\\microsoft\\Windows\\CurrentVersion\\"/>
    <add key="Dir" value="run"/>
</db1>
<db2><add key="fdir" value="hardware\\microsoft\\Windows\\CurrentVersion\\"/>
    <add key="Dir" value="runonce"/></db2>
</appSettings>
  
</configuration>

解决方案 »

  1.   

    如果你用APPSETTINGS的话估计没戏了。你可以自己继承IConfigurationSectionHandler后实现你的效果。
      

  2.   

      <appSettings>
            <add key="fdir1" value="software\\microsoft\\Windows\\CurrentVersion\\"/>
            <add key="Dir1" value="run"/>
            <add key="fdir2" value="hardware\\microsoft\\Windows\\CurrentVersion\\"/>
            <add key="Dir2" value="runonce"/>
        </appSettings>直接根据key取
      

  3.   

    <?xml version="1.0" encoding="utf-8" ?>  <configuration>
        <configSections>
          <sectionGroup name="mySectionGroup">
            <section name="mySection"
               type="System.Configuration.NameValueSectionHandler" />
          </sectionGroup>
        </configSections>
        <mySectionGroup>
          <mySection>
            <add key="key1" value="value1" />
          </mySection>
        </mySectionGroup>
      </configuration>我现在想用sectiongroup来实现为什么说找不到架构信息呢