ProfileEventArgsとは? わかりやすく解説

ProfileEventArgs クラス

メモ : このクラスは、.NET Framework version 2.0新しく追加されたものです。

ProfileModule クラスPersonalize イベントデータ提供します

名前空間: System.Web.Profile
アセンブリ: System.Web (system.web.dll 内)
構文構文

Public NotInheritable Class
 ProfileEventArgs
    Inherits EventArgs
Dim instance As ProfileEventArgs
public sealed class ProfileEventArgs : EventArgs
public ref class ProfileEventArgs sealed :
 public EventArgs
public final class ProfileEventArgs extends
 EventArgs
public final class ProfileEventArgs extends
 EventArgs
解説解説

イベント実行中に ProfileEventArgs クラス使用してPersonalize カスタム ユーザー プロファイル指定できますPersonalize イベント完了時に、ProfileEventHandler の ProfileEventArgs パラメータProfile プロパティnull 参照 (Visual Basic では Nothing) でない値に設定されている場合ProfileModule は、現在の HttpContext 内にある Profile プロパティの値を使用します

使用例使用例

アプリケーションの Global.asax ファイル宣言されPersonalize イベント方法次のコード例示しますイベント コードは、ロール メンバシップ基づいてユーザー プロファイルロードします

Public Sub Profile_Personalize(sender As
 Object, args As ProfileEventArgs)
  Dim userProfile As ProfileCommon

  If User Is Nothing Then
 Return

  userProfile = CType(ProfileBase.Create(User.Identity.Name), ProfileCommon)

  If User.IsInRole("Administrators")
 Then
    userProfile = userProfile.GetProfile("Administrator")
  Else
    If User.IsInRole("Users") Then
      userProfile = userProfile.GetProfile("User")
    Else
      userProfile = userProfile.GetProfile("Guest")
    End If
  End If

  If Not userProfile Is
 Nothing Then _
    args.Profile = userProfile
End Sub
public void Profile_Personalize(object sender,
 ProfileEventArgs args)
{
  ProfileCommon userProfile;

  if (User == null) { return;
 }

  userProfile = (ProfileCommon)ProfileBase.Create(User.Identity.Name);

  if (User.IsInRole("Administrators"))
    userProfile = userProfile.GetProfile("Administrator");
  else
    if (User.IsInRole("Users"))
      userProfile = userProfile.GetProfile("User");
    else
      userProfile = userProfile.GetProfile("Guest");

  if (userProfile != null)
    args.Profile = userProfile;
}
.NET Framework のセキュリティ.NET Frameworkセキュリティ
継承階層継承階層
System.Object
   System.EventArgs
    System.Web.Profile.ProfileEventArgs
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

ProfileEventArgs コンストラクタ

メモ : このコンストラクタは、.NET Framework version 2.0新しく追加されたものです。

ProfileEventArgs クラスインスタンス作成します

名前空間: System.Web.Profile
アセンブリ: System.Web (system.web.dll 内)
構文構文

Public Sub New ( _
    context As HttpContext _
)
Dim context As HttpContext

Dim instance As New ProfileEventArgs(context)
public ProfileEventArgs (
    HttpContext context
)
public:
ProfileEventArgs (
    HttpContext^ context
)
public ProfileEventArgs (
    HttpContext context
)
public function ProfileEventArgs (
    context : HttpContext
)

パラメータ

context

現在の要求の HttpContext。

解説解説

ProfileEventArgs は、ProfileEventArgs クラスインスタンス作成しContext プロパティ指定されHttpContext設定します

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

ProfileEventArgs プロパティ


ProfileEventArgs メソッド


ProfileEventArgs メンバ

ProfileModule クラスPersonalize イベントデータ提供します

ProfileEventArgs データ型公開されるメンバを以下の表に示します


パブリック コンストラクタパブリック コンストラクタ
  名前 説明
パブリック メソッド ProfileEventArgs ProfileEventArgs クラスインスタンス作成します
パブリック プロパティパブリック プロパティ
パブリック メソッドパブリック メソッド
プロテクト メソッドプロテクト メソッド
参照参照

関連項目

ProfileEventArgs クラス
System.Web.Profile 名前空間

その他の技術情報

ASP.NET プロファイル プロパティ



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「ProfileEventArgs」の関連用語

ProfileEventArgsのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



ProfileEventArgsのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS