Share via


ProfileProvider.GetAllInactiveProfiles 方法

定義

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

public:
 abstract System::Web::Profile::ProfileInfoCollection ^ GetAllInactiveProfiles(System::Web::Profile::ProfileAuthenticationOption authenticationOption, DateTime userInactiveSinceDate, int pageIndex, int pageSize, [Runtime::InteropServices::Out] int % totalRecords);
public abstract System.Web.Profile.ProfileInfoCollection GetAllInactiveProfiles (System.Web.Profile.ProfileAuthenticationOption authenticationOption, DateTime userInactiveSinceDate, int pageIndex, int pageSize, out int totalRecords);
abstract member GetAllInactiveProfiles : System.Web.Profile.ProfileAuthenticationOption * DateTime * int * int * int -> System.Web.Profile.ProfileInfoCollection
Public MustOverride Function GetAllInactiveProfiles (authenticationOption As ProfileAuthenticationOption, userInactiveSinceDate As DateTime, pageIndex As Integer, pageSize As Integer, ByRef totalRecords As Integer) As ProfileInfoCollection

參數

authenticationOption
ProfileAuthenticationOption

ProfileAuthenticationOption 的其中一個值,指定是否要傳回匿名、已驗證或是這兩種類型的設定檔。

userInactiveSinceDate
DateTime

DateTime,識別哪些使用者設定檔視為非現用。 如果使用者設定檔的 LastActivityDate 發生在這個日期與時間或之前,則會將其視為非使用中設定檔。

pageIndex
Int32

要傳回的結果網頁索引。

pageSize
Int32

要傳回的結果網頁大小。

totalRecords
Int32

當方法回傳時,包含設定檔的總數。

傳回

ProfileInfoCollection

ProfileInfoCollection,包含關於非現用設定檔的使用者設定檔資訊。

範例

下列程式碼範例顯示 方法實作的方法 GetAllInactiveProfiles 簽章。 如需完整 ProfileProvider 實作的範例,請參閱 如何:建置和執行設定檔提供者範例

public override ProfileInfoCollection GetAllInactiveProfiles(
    ProfileAuthenticationOption authenticationOption,
    DateTime userInactiveSinceDate,
    int pageIndex,
    int pageSize,
    out int totalRecords)
{
    totalRecords = 0;

    return new ProfileInfoCollection();
}
Public Overrides Function GetAllInactiveProfiles( _
ByVal authenticationOption As ProfileAuthenticationOption, _
ByVal userInactiveSinceDate As DateTime, _
ByVal pageIndex As Integer, _
ByVal pageSize As Integer, _
 ByRef totalRecords As Integer) As ProfileInfoCollection

  totalRecords = 0

  Return New ProfileInfoCollection()
End Function

備註

方法 GetAllInactiveProfiles 可用來擷取未使用使用者設定檔的設定檔資訊。 只會傳回組態檔中指定的 資料 applicationName 。 參數 authenticationOption 會指定只搜尋匿名設定檔、僅限已驗證的設定檔或所有設定檔。 在搜尋的設定檔中,傳 LastActivityDate 回指定 userInactiveSinceDate 之參數值之前發生或之前的任何設定檔。

GetAllInactiveProfiles 回的結果受限於 pageIndexpageSize 參數。 參數 pageSize 會識別 在 中 ProfileInfoCollection 傳回的物件 ProfileInfo 數目上限。 參數 pageIndex 會識別要傳回的結果頁面,其中零會識別第一頁。 參數 totalRecords 是參數 out ,根據 和 userInactiveSinceDate 參數,設定為所設定 applicationName authenticationOption 的非使用中使用者設定檔總數。 例如,如果已設定 applicationName 的使用者有 13 個,且 pageIndex 值為 1 且 pageSize 值為 5,則 ProfileInfoCollection 傳回的 會包含傳回的第六個到第十個非使用中設定檔。 參數 totalRecords 會設定為 13。

適用於

另請參閱