語言

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 作方式儲存在資料來源中。 你可以使用.NET框架中包含的設定檔提供者(由 ProfileProvider 抽象類別衍生的類別表示),或者你也可以建立一個源自 ProfileProvider 的新類別來實作自己的提供者。

建立自訂檔案服務有兩個主要原因。

  • 您需要將設定檔資訊儲存在 .NET 框架內建的設定檔提供者不支援的資料來源中,例如 FoxPro 資料庫、Oracle 資料庫或其他資料儲存庫。

  • 你需要使用與 .NET Framework 內建服務提供者所使用的資料庫架構不同的資料庫架構來管理設定檔資訊。 一個常見的例子是公司網路或網站中已存在於 SQL Server 資料庫中的使用者資料。

ProfileProvider抽象類別繼承自SettingsProvider抽象類別,抽象類別繼承自ProviderBase抽象類別。 實作ProfileProvider的類別也必須實作 和 SettingsProvider 抽象類別所需的成員ProviderBase。 欲了解更多關於實作設定檔提供者的資訊,請參閱 「實作設定檔提供者」。

建構函式

名稱 Description
ProfileProvider()

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

屬性

名稱 Description
ApplicationName

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

(繼承來源 SettingsProvider)
Description

取得簡短且易記的描述,適合顯示在系統管理工具或其他使用者介面中。

(繼承來源 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)

適用於

另請參閱