110,536
社区成员
发帖
与我相关
我的任务
分享
<sectionGroup name="userSettings" type="System.Configuration.NameValueSectionHandler">
<section name="id" type="System.Configuration.NameValueSectionHandler"/>
<section name="pw" type="System.Configuration.NameValueSectionHandler"/>
</sectionGroup>
<userSettings>
<add key="id" value="myname"/>
<add key="pw" value="123456"/>
</userSettings>
<configuration>
<configSections>
<sectionGroup name="system.web" type="System.Web.Configuration.SystemWebSectionGroup, System.Web, Version=%ASSEMBLY_VERSION%, Culture=neutral, PublicKeyToken=%MICROSOFT_PUBLICKEY%">
<section name="authentication" type="System.Web.Configuration.AuthenticationSection, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineToApplication" />
<!-- Other system.web sections -->
</sectionGroup>
<!-- Other configuration sections -->
</configSections>
<configuration>
<configSections>
<section name="sampleSection"
type="System.Configuration.SingleTagSectionHandler" />
</configSections>
<sampleSection setting1="Value1"
setting2="value two"
setting3="third value" />
</configuration>
<configSections>
<sectionGroup name="Helper.userSettings" type="System.Configuration.ConfigurationSectionGroup, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<section name="userSettings" type="System.Configuration.NameValueSectionHandler"/>
</sectionGroup>
</configSections>
<userSettings>
<add key="Demo" value="test3"/>
</userSettings>
<configSections>
<section name="test1" type="System.Configuration.NameValueSectionHandler"/>
<section name="test2" type="System.Configuration.NameValueSectionHandler"/>
</configSections>
<test1>
<add key="Demo" value="test"/>
</test1>
去掉<sectionGroup>直接用
<section name="userSettings" type="System.Configuration.NameValueSectionHandler"></section>
或者
<sectionGroup name="命名空间.userSettings" type="System.Configuration.ConfigurationSectionGroup, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<section name="userSettings" type="System.Configuration.NameValueSectionHandler"></section>
</sectionGroup>