ProfileProvider 類別

定義

定義合約,由 ASP.NET 實作,使用自訂設定檔提供者來提供設定檔服務。

public ref class ProfileProvider abstract : System::Configuration::SettingsProvider
public abstract class ProfileProvider : System.Configuration.SettingsProvider
type ProfileProvider = class
    inherit SettingsProvider
Public MustInherit Class ProfileProvider
Inherits SettingsProvider
繼承
衍生

範例

如需實作的 ProfileProvider 範例,請參閱 如何:建置和執行設定檔提供者範例

備註

ASP.NET 設定檔提供持續儲存和擷取使用者特定屬性。 配置檔案屬性值和資訊是以實作所 ProfileProvider 決定的方式儲存在資料來源中。 您可以使用衍生自 ProfileProvider 抽象類別) 的類別所代表之.NET Framework (隨附的設定檔提供者,也可以建立衍生自 ProfileProvider 的新類別來實作自己的提供者。

建立自訂設定檔提供者有兩個主要原因。

  • 您必須將設定檔資訊儲存在.NET Framework隨附的設定檔提供者不支援的資料來源中,例如 FoxPro 資料庫、Oracle 資料庫或其他資料存放區。

  • 您必須使用與隨附.NET Framework提供者所使用的資料庫架構不同的資料庫架構來管理設定檔資訊。 常見的範例是已存在於公司網路或網站的SQL Server資料庫中的使用者資料。

ProfileProvider抽象類別繼承自 SettingsProvider 抽象類別,其繼承自 ProviderBase 抽象類別。 實 ProfileProvider 作的 SettingsProvider 類別也必須實作 和 ProviderBase 抽象類別的必要成員。 如需實作設定檔提供者的詳細資訊,請參閱 實作設定檔提供者

建構函式

ProfileProvider()

初始化 ProfileProvider 類別的新執行個體。

屬性

ApplicationName

取得或設定目前正在執行之應用程式的名稱。

(繼承來源 SettingsProvider)
Description

取得簡短、易讀的描述,適合顯示在管理工具或其他使用者介面 (UI) 中。

(繼承來源 ProviderBase)
Name

取得用來在設定期間代表提供者的易記名稱。

(繼承來源 ProviderBase)

方法

DeleteInactiveProfiles(ProfileAuthenticationOption, DateTime)

在衍生的類別中覆寫時,會刪除上次活動日期發生在指定日期之前的設定檔中所有使用者設定檔資料。

DeleteProfiles(ProfileInfoCollection)

在衍生類別中覆寫時,會針對提供的設定檔清單,刪除這些設定檔的屬性和資訊。

DeleteProfiles(String[])

在衍生類別中覆寫時,會針對符合提供的使用者名稱清單之設定檔,刪除這些設定檔的屬性和資訊。

Equals(Object)

判斷指定的物件是否等於目前的物件。

(繼承來源 Object)
FindInactiveProfilesByUserName(ProfileAuthenticationOption, String, DateTime, Int32, Int32, Int32)

在衍生類別中覆寫時,會擷取上次活動日期發生在指定的日期或之前,且使用者名稱符合指定的使用者名稱之設定檔的設定檔資訊。

FindProfilesByUserName(ProfileAuthenticationOption, String, Int32, Int32, Int32)

在衍生類別中覆寫時,會擷取使用者名稱符合指定使用者名稱之設定檔的設定檔資訊。

GetAllInactiveProfiles(ProfileAuthenticationOption, DateTime, Int32, Int32, Int32)

在衍生的類別中覆寫時,會從資料來源擷取上次活動日期發生在指定日期當天或之前的設定檔之使用者設定檔資料。

GetAllProfiles(ProfileAuthenticationOption, Int32, Int32, Int32)

在衍生類別中覆寫時,會擷取資料來源中所有設定檔的使用者設定檔資料。

GetHashCode()

做為預設雜湊函式。

(繼承來源 Object)
GetNumberOfInactiveProfiles(ProfileAuthenticationOption, DateTime)

在衍生的類別中覆寫時,會傳回上次活動日期發生在指定日期當天或之前的設定檔數目。

GetPropertyValues(SettingsContext, SettingsPropertyCollection)

傳回指定之應用程式執行個體和設定屬性群組的設定屬性值集合。

(繼承來源 SettingsProvider)
GetType()

取得目前執行個體的 Type

(繼承來源 Object)
Initialize(String, NameValueCollection)

初始化設定產生器。

(繼承來源 ProviderBase)
MemberwiseClone()

建立目前 Object 的淺層複製。

(繼承來源 Object)
SetPropertyValues(SettingsContext, SettingsPropertyValueCollection)

設定指定屬性設定群組的值。

(繼承來源 SettingsProvider)
ToString()

傳回代表目前物件的字串。

(繼承來源 Object)

適用於

另請參閱