AnonymousIdentificationEventHandler デリゲートとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > AnonymousIdentificationEventHandler デリゲートの意味・解説 

AnonymousIdentificationEventHandler デリゲート

メモ : このデリゲートは、.NET Framework version 2.0 で新しく追加されたものです。

AnonymousIdentificationModule の AnonymousIdentification_Creating イベントを処理するメソッドを表します。

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

Public Delegate Sub AnonymousIdentificationEventHandler
 ( _
    sender As Object, _
    e As AnonymousIdentificationEventArgs _
)
Dim instance As New AnonymousIdentificationEventHandler(AddressOf
 HandlerMethod)
public delegate void AnonymousIdentificationEventHandler
 (
    Object sender,
    AnonymousIdentificationEventArgs e
)
public delegate void AnonymousIdentificationEventHandler
 (
    Object^ sender, 
    AnonymousIdentificationEventArgs^ e
)
/** @delegate */
public delegate void AnonymousIdentificationEventHandler
 (
    Object sender, 
    AnonymousIdentificationEventArgs e
)
JScript では、デリゲートは使用できますが、新規に宣言することはできません。

パラメータ

sender

イベントのソース。

e

イベント データを格納している AnonymousIdentificationEventArgs。

解説解説

AnonymousIdentificationEventHandler デリゲートは、AnonymousIdentificationModule クラスの Creating イベントに対して定義されています。AnonymousIdentificationModule クラスの Creating イベントには、ASP.NET アプリケーションの Global.asax ファイルに、AnonymousIdentification_Creating というサブルーチンを指定することによってアクセスできます。Creating イベントは、PostAuthenticateRequest イベント時に生成されます。

AnonymousIdentificationModule は、現在の HttpContext を使用して AnonymousIdentificationEventArgs オブジェクトを生成し、それを AnonymousIdentification_Creating イベントに渡します。

AnonymousIdentification_Creating イベントに渡した AnonymousIdentificationEventArgs オブジェクトの AnonymousId プロパティを使用して、匿名 ID をカスタム値に設定できます。AnonymousIdentification_Creating イベント時に AnonymousId プロパティに値を指定しなかった場合は、Guid が使用されます。

AnonymousIdentification_Creating イベントは、anonymousIdentification 構成要素を true に設定することにより、匿名 ID が Enabled である場合にだけ発生します。

使用例使用例

AnonymousIdentification_Creating イベントを使用して、匿名 ID をカスタム値に設定するコード例を次に示します。

Public Sub AnonymousIdentification_Creating(sender
 As Object,  _
                                            args As AnonymousIdentificationEventArgs)
  args.AnonymousID = Samples.AspNet.Security.MyIdClass.GetAnonymousId()
  Samples.AspNet.Security.MyIdClass.LogAnonymousId(args.AnonymousId)
End Sub
public void AnonymousIdentification_Creating(object
 sender, 
                                             AnonymousIdentificationEventArgs args)
{
  args.AnonymousID = Samples.AspNet.Security.MyIdClass.GetAnonymousId();
  Samples.AspNet.Security.MyIdClass.LogAnonymousId(args.AnonymousID);
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
System.Web.Security 名前空間
その他の技術情報
anonymousIdentification 要素 (ASP.NET 設定スキーマ)
Global.asax 構文



英和和英テキスト翻訳

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

辞書ショートカット

すべての辞書の索引

AnonymousIdentificationEventHandler デリゲートのお隣キーワード
検索ランキング

   

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



AnonymousIdentificationEventHandler デリゲートのページの著作権

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

©2026 GRAS Group, Inc.RSS