ProfileProvider.FindProfilesByUserName メソッド

定義

派生クラスでオーバーライドされると、ユーザー名が指定したユーザー名と一致するプロファイルのプロファイル情報を取得します。

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

パラメーター

authenticationOption
ProfileAuthenticationOption

匿名、認証、または両方の種類のプロファイルを返すかどうかを指定する、 ProfileAuthenticationOption 値の 1 つ。

usernameToMatch
String

検索するユーザー名。

pageIndex
Int32

返される結果のページのインデックス。

pageSize
Int32

返される結果のページのサイズ。

totalRecords
Int32

このメソッドから制御が戻るときに、プロファイルの合計数が格納されます。

返品

ユーザー名が指定された ProfileInfoCollection パラメーターと一致するプロファイルのユーザー プロファイル情報を含むusernameToMatch

次のコード例は、 FindProfilesByUserName メソッドの実装のメソッド シグネチャを示しています。 完全な ProfileProvider 実装の例については、「 方法: プロファイル プロバイダーの例をビルドして実行する」を参照してください。

public override ProfileInfoCollection FindProfilesByUserName(
    ProfileAuthenticationOption authenticationOption,
    string usernameToMatch,
    int pageIndex,
    int pageSize,
    out int totalRecords)
{
    totalRecords = 0;

    return new ProfileInfoCollection();
}
Public Overrides Function FindProfilesByUserName( _
ByVal authenticationOption As ProfileAuthenticationOption, _
ByVal usernameToMatch As String, _
ByVal pageIndex As Integer, _
ByVal pageSize As Integer, _
 ByRef totalRecords As Integer) As ProfileInfoCollection

  totalRecords = 0

  Return New ProfileInfoCollection()
End Function

注釈

FindProfilesByUserName メソッドは、ユーザー名が指定されたusernameToMatch パラメーターと一致するプロファイルのプロファイル情報の一覧を返します。 構成ファイルで指定された applicationName のデータのみが返されます。 authenticationOption パラメーターは、匿名プロファイルのみ、認証済みプロファイルのみ、またはすべてのプロファイルを検索するかどうかを指定します。

データ ソースでワイルドカード文字などの追加の検索機能がサポートされている場合は、ユーザー名に対してより広範な検索機能を提供できます。

FindProfilesByUserNameによって返される結果は、pageIndexパラメーターとpageSize パラメーターによって制限されます。 pageSize パラメーターは、ProfileInfoで返ProfileInfoCollectionオブジェクトの最大数を識別します。 pageIndex パラメーターは、返す結果のページを識別します。0 は最初のページを識別します。 totalRecords パラメーターは、outパラメーターとapplicationName パラメーターに基づいて、構成されたauthenticationOptionの非アクティブなユーザー プロファイルの合計数に設定されるuserInactiveSinceDate パラメーターです。 たとえば、構成された applicationNameに 13 人のユーザーがいて、 pageIndex 値が 1 で pageSize が 5 の場合、返される ProfileInfoCollection には、返される 6 番目から 10 番目の非アクティブプロファイルが含まれます。 totalRecords パラメーターは 13 に設定されます。

適用対象

こちらもご覧ください