ProfileSection.Enabled 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定一個值,表示 ASP.NET 設定功能是否啟用。
public:
property bool Enabled { bool get(); void set(bool value); };
[System.Configuration.ConfigurationProperty("enabled", DefaultValue=true)]
public bool Enabled { get; set; }
[<System.Configuration.ConfigurationProperty("enabled", DefaultValue=true)>]
member this.Enabled : bool with get, set
Public Property Enabled As Boolean
屬性值
true如果 ASP.NET 編譯系統應該產生ProfileCommon一個可用來存取個別使用者資料的類別;否則,。 false 預設值為 true。
- 屬性
範例
以下程式碼範例說明如何使用該 Enabled 屬性。 此程式碼範例是本類別更大範例 ProfileSection 的一部分。
// Get the current Enabled property value.
Console.WriteLine(
"Current Enabled value: '{0}'", profileSection.Enabled);
// Set the Enabled property to false.
profileSection.Enabled = false;
' Get the current Enabled property value.
Console.WriteLine( _
"Current Enabled value: '{0}'", profileSection.Enabled)
' Set the Enabled property to false.
profileSection.Enabled = false
備註
當屬性 Enabled 為 false時,個人檔案功能會被停用,且你將無法從 ASP.NET 程式碼中存取使用者個人檔案資訊。
當屬性為 true時,執行時 ASP.NET 編譯系統會利用該 profile 節中指定的資訊產生一個稱為 ProfileCommon的類別,該類別由 衍生而來 ProfileBase。