ProfileSection.DefaultProvider 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定預設設定檔提供者的名稱。
public:
property System::String ^ DefaultProvider { System::String ^ get(); void set(System::String ^ value); };
[System.Configuration.ConfigurationProperty("defaultProvider", DefaultValue="AspNetSqlProfileProvider")]
[System.Configuration.StringValidator(MinLength=1)]
public string DefaultProvider { get; set; }
[<System.Configuration.ConfigurationProperty("defaultProvider", DefaultValue="AspNetSqlProfileProvider")>]
[<System.Configuration.StringValidator(MinLength=1)>]
member this.DefaultProvider : string with get, set
Public Property DefaultProvider As String
屬性值
集合中 Providers 提供者的名稱,或空字串(“”)。 預設為「AspNetSqlProfileProvider」。
- 屬性
範例
以下程式碼範例說明如何使用該 DefaultProvider 屬性。 此程式碼範例是本類別更大範例 ProfileSection 的一部分。
// Get the current DefaultProvider property value.
Console.WriteLine(
"Current DefaultProvider value: '{0}'", profileSection.DefaultProvider);
// Set the DefaultProvider property to "AspNetSqlProvider".
profileSection.DefaultProvider = "AspNetSqlProvider";
' Get the current DefaultProvider property value.
Console.WriteLine( _
"Current DefaultProvider value: '{0}'", profileSection.DefaultProvider)
' Set the DefaultProvider property to "AspNetSqlProvider".
profileSection.DefaultProvider = "AspNetSqlProvider"
備註
設定檔提供者指向儲存使用者設定檔值的資料來源。 你可以在 providers 設定檔的子節 profile 中指定設定檔提供者。