共用方式為


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 抽象類的必要成員。 如需實作配置檔提供者的詳細資訊,請參閱 實作配置檔提供者

建構函式

名稱 Description
ProfileProvider()

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

屬性

名稱 Description
ApplicationName

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

(繼承來源 SettingsProvider)
Description

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

(繼承來源 ProviderBase)
Name

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

(繼承來源 ProviderBase)

方法

名稱 Description
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)

適用於

另請參閱