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

WebRequestEvent クラス

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

Web 要求情報提供するイベント基本クラス定義します

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

Public Class WebRequestEvent
    Inherits WebManagementEvent
Dim instance As WebRequestEvent
public class WebRequestEvent : WebManagementEvent
public ref class WebRequestEvent : public
 WebManagementEvent
public class WebRequestEvent extends WebManagementEvent
public class WebRequestEvent extends
 WebManagementEvent
解説解説
使用例使用例

WebRequestEvent クラス派生としてカスタム イベント作成する方法次のコード例示します

Imports System
Imports System.Text
Imports System.Web
Imports System.Web.Management
Imports System.Web.UI
Imports System.Web.UI.WebControls


' Implements a custom WebRequestEvent. 
Public Class SampleWebRequestEvent
    Inherits System.Web.Management.WebRequestEvent
    Private customCreatedMsg, customRaisedMsg As
 String
    
    
    ' Invoked in case of events identified only 
    ' by their event code.
    Public Sub New(ByVal
 msg As String, _
    ByVal eventSource As Object,
 _
    ByVal eventCode As Integer)
        MyBase.New(msg, eventSource, eventCode)

        ' Perform custom initialization.
        customCreatedMsg = String.Format( _
        "Event created at: {0}", _
        EventTime.ToString())

    End Sub 'New
    
    
    ' Invoked in case of events identified 
    ' by their event code.and 
    ' related event detailed code.
    Public Sub New(ByVal
 msg As String, _
    ByVal eventSource As Object,
 _
    ByVal eventCode As Integer,
 _
    ByVal eventDetailCode As Integer)
        MyBase.New(msg, eventSource, _
        eventCode, eventDetailCode)
        ' Perform custom initialization.
        customCreatedMsg = String.Format( _
        "Event created at: {0}", _
        EventTime.ToString())

    End Sub 'New
    

    ' Raises the SampleWebRequestEvent.
    Public Overrides Sub
 Raise() 
        ' Perform custom processing.
        customRaisedMsg = String.Format( _
        "Event raised at: {0}", _
        EventTime.ToString())
        
        ' Raise the event.
        MyBase.Raise()
    
    End Sub 'Raise
    
    
    'Formats Web request event information.
    Public Overrides Sub
 FormatCustomEventDetails( _
    ByVal formatter As WebEventFormatter)
        ' Add custom data.
        formatter.AppendLine("")

        formatter.IndentationLevel += 1
        formatter.AppendLine( _
        "* Custom Request Information Start *")

        '// Display custom event timing.
        formatter.AppendLine(customCreatedMsg)
        formatter.AppendLine(customRaisedMsg)

        formatter.AppendLine( _
        "* Custom Request Information End *")

        formatter.IndentationLevel -= 1

    End Sub 'FormatCustomEventDetails
 
End Class 'SampleWebRequestEvent

using System;
using System.Text;
using System.Web;
using System.Web.Management;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace SamplesAspNet
{
    // Implements a custom WebRequestEvent. 
    public class SampleWebRequestEvent :
      System.Web.Management.WebRequestEvent
    {
        private string  customCreatedMsg, 
                        customRaisedMsg;

        // Invoked in case of events identified only 
        // by their event code.
        public SampleWebRequestEvent(
            string msg, 
            object eventSource, int eventCode): 
            base(msg, eventSource, eventCode)
        {
           
            // Perform custom initialization.
            customCreatedMsg =
              string.Format(
              "Event created at: {0}", 
              EventTime.ToString());
        }


        // Invoked in case of events identified 
        // by their event code.and 
        // related event detailed code.
        public SampleWebRequestEvent(string
 msg,
            object eventSource, int eventCode,
            int eventDetailCode):
            base(msg, eventSource, eventCode, 
            eventDetailCode)
        {
            // Perform custom initialization.
            customCreatedMsg =
              string.Format(
              "Event created at: {0}", 
              EventTime.ToString());

        }


        // Raises the SampleWebRequestEvent.
        public override void Raise()
        {
            // Perform custom processing.
            customRaisedMsg =
              string.Format(
              "Event raised at: {0}", 
              EventTime.ToString());

            // Raise the event.
            base.Raise();
        }


        //Formats Web request event information.
        public override void FormatCustomEventDetails(
            WebEventFormatter formatter)
        {
            // Add custom data.
            formatter.AppendLine("");

            formatter.IndentationLevel += 1;
            formatter.AppendLine(
                "* Custom Request Information Start *");

            //// Display custom event timing.
            formatter.AppendLine(customCreatedMsg);
            formatter.AppendLine(customRaisedMsg);

            formatter.AppendLine(
                "* Custom Request Information End *");

            formatter.IndentationLevel -= 1;

        }

    }
}

次に示すのは、ASP.NETカスタム イベント使用できるようにする構成ファイル抜粋です。

<healthMonitoring 
  enabled="true" heartBeatInterval="0">

  <providers>
    <!-- Define the custom provider that 
         processes custom Web request events. -->
    <add name="SampleWebEventProvider" 
type="SamplesAspNet.SampleEventProvider,webeventprovider,Version=1.0.1573.18094,
 Culture=neutral, PublicKeyToken=b5a57a9a9d487cf4, processorArchitecture=MSIL"/>

  </providers>

  <eventMappings>

    <!--  Define the event source that 
         issues custom events.   -->
    <add  name="SampleWebRequestEvent" 
type="SamplesAspNet.SampleWebRequestEvent,webrequestevent,Version=1.0.1573.23947,
 Culture=neutral, PublicKeyToken=e717d983a78c8ddb, processorArchitecture=MSIL"/>
  
  </eventMappings>
  
  <rules>
    
    <!-- Associate custom event with 
        related custom provider -->
    <add 
      name="CustomWebRequestEvent"
      eventName="SampleWebRequestEvent" 
      provider="SampleWebEventProvider" 
      profile="Critical"/>

  </rules>

</healthMonitoring>
継承階層継承階層
System.Object
   System.Web.Management.WebBaseEvent
     System.Web.Management.WebManagementEvent
      System.Web.Management.WebRequestEvent
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
WebRequestEvent メンバ
System.Web.Management 名前空間
その他の技術情報
healthMonitoring 要素 (ASP.NET 設定スキーマ)
ASP.NET の状態監視

WebRequestEvent コンストラクタ (String, Object, Int32)

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

イベント パラメータ指定して WebRequestEvent クラス初期化します。

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

Protected Friend Sub New
 ( _
    message As String, _
    eventSource As Object, _
    eventCode As Integer _
)
Dim message As String
Dim eventSource As Object
Dim eventCode As Integer

Dim instance As New WebRequestEvent(message,
 eventSource, eventCode)
protected internal WebRequestEvent (
    string message,
    Object eventSource,
    int eventCode
)
protected public:
WebRequestEvent (
    String^ message, 
    Object^ eventSource, 
    int eventCode
)
protected WebRequestEvent (
    String message, 
    Object eventSource, 
    int eventCode
)
protected internal function
 WebRequestEvent (
    message : String, 
    eventSource : Object, 
    eventCode : int
)

パラメータ

message

イベント関連付けられているメッセージ

eventSource

イベントソースであるオブジェクト

eventCode

イベント関連付けられている WebEventCodes コード。これは WebExtendedBase よりも大きくする必要があります

解説解説
使用例使用例

このコンストラクタカスタマイズするコードの例次に示します

メモメモ

イベントコードまたは識別子の定義に使用する値は、WebExtendedBase より大きくする必要があります

' Invoked in case of events identified only 
' by their event code.
Public Sub New(ByVal
 msg As String, _
ByVal eventSource As Object,
 _
ByVal eventCode As Integer)
    MyBase.New(msg, eventSource, eventCode)

    ' Perform custom initialization.
    customCreatedMsg = String.Format( _
    "Event created at: {0}", _
    EventTime.ToString())

End Sub 'New

// Invoked in case of events identified only 
// by their event code.
public SampleWebRequestEvent(
    string msg, 
    object eventSource, int eventCode): 
    base(msg, eventSource, eventCode)
{
   
    // Perform custom initialization.
    customCreatedMsg =
      string.Format(
      "Event created at: {0}", 
      EventTime.ToString());
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
WebRequestEvent クラス
WebRequestEvent メンバ
System.Web.Management 名前空間

WebRequestEvent コンストラクタ (String, Object, Int32, Int32)

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

イベント パラメータ指定して WebRequestEvent クラス初期化します。

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

Protected Friend Sub New
 ( _
    message As String, _
    eventSource As Object, _
    eventCode As Integer, _
    eventDetailCode As Integer _
)
Dim message As String
Dim eventSource As Object
Dim eventCode As Integer
Dim eventDetailCode As Integer

Dim instance As New WebRequestEvent(message,
 eventSource, eventCode, eventDetailCode)
protected internal WebRequestEvent (
    string message,
    Object eventSource,
    int eventCode,
    int eventDetailCode
)
protected public:
WebRequestEvent (
    String^ message, 
    Object^ eventSource, 
    int eventCode, 
    int eventDetailCode
)
protected WebRequestEvent (
    String message, 
    Object eventSource, 
    int eventCode, 
    int eventDetailCode
)
protected internal function
 WebRequestEvent (
    message : String, 
    eventSource : Object, 
    eventCode : int, 
    eventDetailCode : int
)

パラメータ

message

イベント関連付けられているメッセージ

eventSource

イベントソースであるオブジェクト

eventCode

イベント関連付けられている WebEventCodes コード。これは WebExtendedBase よりも大きくする必要があります

eventDetailCode

イベント関連付けられている WebEventCodes 詳細コード

解説解説
使用例使用例

このコンストラクタカスタマイズするコードの例次に示します

メモメモ

イベントコードまたは識別子の定義に使用する値は、WebExtendedBase より大きくする必要があります

' Invoked in case of events identified 
' by their event code.and 
' related event detailed code.
Public Sub New(ByVal
 msg As String, _
ByVal eventSource As Object,
 _
ByVal eventCode As Integer,
 _
ByVal eventDetailCode As Integer)
    MyBase.New(msg, eventSource, _
    eventCode, eventDetailCode)
    ' Perform custom initialization.
    customCreatedMsg = String.Format( _
    "Event created at: {0}", _
    EventTime.ToString())

End Sub 'New

// Invoked in case of events identified 
// by their event code.and 
// related event detailed code.
public SampleWebRequestEvent(string msg,
    object eventSource, int eventCode,
    int eventDetailCode):
    base(msg, eventSource, eventCode, 
    eventDetailCode)
{
    // Perform custom initialization.
    customCreatedMsg =
      string.Format(
      "Event created at: {0}", 
      EventTime.ToString());

}

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
WebRequestEvent クラス
WebRequestEvent メンバ
System.Web.Management 名前空間

WebRequestEvent コンストラクタ

WebRequestEvent クラス新しインスタンス初期化します。
オーバーロードの一覧オーバーロードの一覧

名前 説明
WebRequestEvent (String, Object, Int32) イベント パラメータ指定して WebRequestEvent クラス初期化します。
WebRequestEvent (String, Object, Int32, Int32) イベント パラメータ指定して WebRequestEvent クラス初期化します。
参照参照

関連項目

WebRequestEvent クラス
WebRequestEvent メンバ
System.Web.Management 名前空間

WebRequestEvent プロパティ


パブリック プロパティパブリック プロパティ

  名前 説明
パブリック プロパティ ApplicationInformation  監視中の現在のアプリケーションに関する情報格納している WebApplicationInformation オブジェクト取得します。 ( WebBaseEvent から継承されます。)
パブリック プロパティ EventCode  イベント関連付けられているコード値を取得します。 ( WebBaseEvent から継承されます。)
パブリック プロパティ EventDetailCode  イベント詳細コード取得します。 ( WebBaseEvent から継承されます。)
パブリック プロパティ EventID  イベント関連付けられている識別子取得します。 ( WebBaseEvent から継承されます。)
パブリック プロパティ EventOccurrence  イベント発生した回数を表すカウンタ取得します。 ( WebBaseEvent から継承されます。)
パブリック プロパティ EventSequence  アプリケーションによるイベントの発生回数取得します。 ( WebBaseEvent から継承されます。)
パブリック プロパティ EventSource  イベント発生させるオブジェクト取得します。 ( WebBaseEvent から継承されます。)
パブリック プロパティ EventTime  イベント発生した時刻取得します。 ( WebBaseEvent から継承されます。)
パブリック プロパティ EventTimeUtc  イベント発生した時刻取得します。 ( WebBaseEvent から継承されます。)
パブリック プロパティ Message  イベント説明するメッセージ取得します。 ( WebBaseEvent から継承されます。)
パブリック プロパティ ProcessInformation  ASP.NET アプリケーション ホスト プロセスに関する情報取得します。 ( WebManagementEvent から継承されます。)
パブリック プロパティ RequestInformation Web アプリケーション要求関連付けられた情報取得します
参照参照

関連項目

WebRequestEvent クラス
System.Web.Management 名前空間

その他の技術情報

healthMonitoring 要素 (ASP.NET 設定スキーマ)
ASP.NET の状態監視

WebRequestEvent メソッド


パブリック メソッドパブリック メソッド

プロテクト メソッドプロテクト メソッド
参照参照

関連項目

WebRequestEvent クラス
System.Web.Management 名前空間

その他の技術情報

healthMonitoring 要素 (ASP.NET 設定スキーマ)
ASP.NET の状態監視

WebRequestEvent メンバ

Web 要求情報提供するイベント基本クラス定義します

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


プロテクト コンストラクタプロテクト コンストラクタ
パブリック プロパティパブリック プロパティ
  名前 説明
パブリック プロパティ ApplicationInformation  監視中の現在のアプリケーションに関する情報格納している WebApplicationInformation オブジェクト取得します。(WebBaseEvent から継承されます。)
パブリック プロパティ EventCode  イベント関連付けられているコード値を取得します。(WebBaseEvent から継承されます。)
パブリック プロパティ EventDetailCode  イベント詳細コード取得します。(WebBaseEvent から継承されます。)
パブリック プロパティ EventID  イベント関連付けられている識別子取得します。(WebBaseEvent から継承されます。)
パブリック プロパティ EventOccurrence  イベント発生した回数を表すカウンタ取得します。(WebBaseEvent から継承されます。)
パブリック プロパティ EventSequence  アプリケーションによるイベントの発生回数取得します。(WebBaseEvent から継承されます。)
パブリック プロパティ EventSource  イベント発生させるオブジェクト取得します。(WebBaseEvent から継承されます。)
パブリック プロパティ EventTime  イベント発生した時刻取得します。(WebBaseEvent から継承されます。)
パブリック プロパティ EventTimeUtc  イベント発生した時刻取得します。(WebBaseEvent から継承されます。)
パブリック プロパティ Message  イベント説明するメッセージ取得します。(WebBaseEvent から継承されます。)
パブリック プロパティ ProcessInformation  ASP.NET アプリケーション ホスト プロセスに関する情報取得します。(WebManagementEvent から継承されます。)
パブリック プロパティ RequestInformation Web アプリケーション要求関連付けられた情報取得します
パブリック メソッドパブリック メソッド
プロテクト メソッドプロテクト メソッド
参照参照

関連項目

WebRequestEvent クラス
System.Web.Management 名前空間

その他の技術情報

healthMonitoring 要素 (ASP.NET 設定スキーマ)
ASP.NET の状態監視



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

辞書ショートカット

すべての辞書の索引

「WebRequestEvent」の関連用語

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

   

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



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

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

©2025 GRAS Group, Inc.RSS