共用方式為


AppSettingsSection Class1

包含自訂應用程式設定,例如檔案路徑、XML Web 服務 URL 或儲存在應用程式.ini檔案中的資訊。

Syntax

class AppSettingsSection : ConfigurationSectionWithCollection  

方法

下表列出 類別所 AppSettingsSection 公開的方法。

名稱 描述
加入 (繼承自 ConfigurationSectionWithCollection.)
清除 (繼承自 ConfigurationSectionWithCollection。)
Get (繼承自 ConfigurationSectionWithCollection。)
GetAllowDefinition (繼承自 ConfigurationSection.)
GetAllowLocation (繼承自 ConfigurationSection。)
移除 (繼承自 ConfigurationSectionWithCollection。)
RevertToParent (繼承自 ConfigurationSection。)
SetAllowDefinition (繼承自 ConfigurationSection。)
SetAllowLocation (繼承自 ConfigurationSection。)

屬性

下表列出 類別所 AppSettingsSection 公開的屬性。

名稱 描述
File 讀取/寫入 string 值,指定外部自訂應用程式組態檔的相對路徑。 指定的路徑相對於本機組態檔。 如果找不到指定的檔案,IIS 會忽略指定的值。

外部檔案使用與 屬性相同的索引鍵/值組格式 AppSettings ,但 <appSettings> 專案不是 <``configuration``> 元素必須是根節點。 注意: 對Web.config檔案所做的變更會導致應用程式重新開機;不過,您可以藉由讓使用者修改 AppSettingsSection 個別檔案中的值來避免這個問題。
Location (繼承自 ConfigurationSection .) 索引鍵屬性。
Path (繼承自 ConfigurationSection .) 索引鍵屬性。
SectionInformation (繼承自 ConfigurationSection。)
AppSettings KeyValueElement值的陣列,其中包含指定應用程式設定名稱和對應值的索引鍵/值組。

子類別

這個類別不包含子類別。

繼承階層架構

ConfigurationSection

ConfigurationSectionWithCollection

AppSettingsSection

規格需求

類型 Description
Client - Windows Vista 上的 IIS 7.0
- Windows 7 上的 IIS 7.5
- Windows 8上的 IIS 8.0
- Windows 10上的 IIS 10.0
伺服器 - Windows Server 2008 上的 IIS 7.0
- Windows Server 2008 R2 上的 IIS 7.5
- Windows Server 2012上的 IIS 8.0
- Windows Server 2012 R2 上的 IIS 8.5
- Windows Server 2016上的 IIS 10.0
產品 - IIS 7.0、IIS 7.5、IIS 8.0、IIS 8.5、IIS 10.0
MOF 檔案 WebAdministration.mof

另請參閱

ConfigurationSection 類別
KeyValueElement 類別
appSettings 的 add 項目 (一般設定結構描述)