下面给出的是现有 asp.net Web 服务程序的 web.config 文件(.asmx 文件)
以下代码将 TEST 的值设置为 EEE。
<setting name="TEST" serializeAs="String">
<value>EEEE</value>
</setting>
这是从代码中使用的
TESTIntegrationWS.Properties.Settings.Default.TEST
如何为名称“TEST”设置多个值并从代码中访问它?
Web.config 文件
<?xml version="1.0" ?>
<configuration>
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="TESTIntegrationWS.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
requirePermission="false" />
</sectionGroup>
</configSections>
<applicationSettings>
<TESTIntegrationWS.Properties.Settings>
<setting name="TEST" serializeAs="String">
<value>EEEE</value>
</setting>
<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
</TESTIntegrationWS.Properties.Settings>
</applicationSettings>
<system.web>
<compilation debug="true" />
</system.web>
</configuration>