IdentitySection 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
配置網頁應用程式的身份。 此類別無法獲得繼承。
public ref class IdentitySection sealed : System::Configuration::ConfigurationSection
public sealed class IdentitySection : System.Configuration.ConfigurationSection
type IdentitySection = class
inherit ConfigurationSection
Public NotInheritable Class IdentitySection
Inherits ConfigurationSection
- 繼承
範例
以下程式碼範例說明如何從現有網頁應用程式的設定檔取得該 IdentitySection 物件。
// Get the Web application configuration.
System.Configuration.Configuration configuration = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("/aspnetTest");
// Get the section.
System.Web.Configuration.IdentitySection identitySection = (System.Web.Configuration.IdentitySection)configuration.GetSection("system.web/identity");
' Get the Web application configuration.
Dim configuration As System.Configuration.Configuration = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("/aspnetTest")
' Get the section.
Dim identitySection As System.Web.Configuration.IdentitySection = CType(configuration.GetSection("system.web/identity"), System.Web.Configuration.IdentitySection)
備註
它 IdentitySection 提供了一種程式化的方式,可以存取並修改設定檔的該 identity 區段。
Note
可以 IdentitySection 根據該區段屬性 AllowDefinition (值為 Everywhere)從設定檔的相關區段讀寫資訊。
建構函式
| 名稱 | Description |
|---|---|
| IdentitySection() |
使用預設參數初始化類別的新實例 IdentitySection 。 |