WebBaseErrorEvent 构造函数

定义

初始化 WebBaseErrorEvent 类的新实例。

重载

WebBaseErrorEvent(String, Object, Int32, Exception)

初始化 WebBaseErrorEvent 类的新实例。

WebBaseErrorEvent(String, Object, Int32, Int32, Exception)

初始化 WebBaseErrorEvent 类的新实例。

WebBaseErrorEvent(String, Object, Int32, Exception)

初始化 WebBaseErrorEvent 类的新实例。

protected public:
 WebBaseErrorEvent(System::String ^ message, System::Object ^ eventSource, int eventCode, Exception ^ e);
protected internal WebBaseErrorEvent (string message, object eventSource, int eventCode, Exception e);
new System.Web.Management.WebBaseErrorEvent : string * obj * int * Exception -> System.Web.Management.WebBaseErrorEvent
Protected Friend Sub New (message As String, eventSource As Object, eventCode As Integer, e As Exception)

参数

message
String

事件说明。

eventSource
Object

作为事件源的对象。

eventCode
Int32

与该事件关联的代码。 实现自定义事件时,事件代码必须大于 WebExtendedBase

e
Exception

与此错误关联的 Exception

示例

下面的代码示例演示如何从 类的 SampleWebBaseErrorEvent 构造函数(派生自 WebBaseErrorEvent 类的类)调用此构造函数。

// Invoked in case of events identified only by their event code.
public SampleWebBaseErrorEvent(string msg, 
    object eventSource, int eventCode, Exception e):
  base(msg, eventSource, eventCode, e)
{
    // Perform custom initialization.
    customCreatedMsg =
      string.Format("Event created at: {0}", 
      DateTime.Now.TimeOfDay.ToString());
}
' 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, ByVal e As Exception)
    MyBase.New(msg, eventSource, eventCode, e)
    ' Perform custom initialization.
    customCreatedMsg = String.Format("Event created at: {0}", _
    DateTime.Now.TimeOfDay.ToString())

End Sub

注解

此构造函数由 ASP.NET 运行状况监视系统在内部使用。 实现自己的从此类继承的事件类型时,可以调用此构造函数。

另请参阅

适用于

WebBaseErrorEvent(String, Object, Int32, Int32, Exception)

初始化 WebBaseErrorEvent 类的新实例。

protected public:
 WebBaseErrorEvent(System::String ^ message, System::Object ^ eventSource, int eventCode, int eventDetailCode, Exception ^ e);
protected internal WebBaseErrorEvent (string message, object eventSource, int eventCode, int eventDetailCode, Exception e);
new System.Web.Management.WebBaseErrorEvent : string * obj * int * int * Exception -> System.Web.Management.WebBaseErrorEvent
Protected Friend Sub New (message As String, eventSource As Object, eventCode As Integer, eventDetailCode As Integer, e As Exception)

参数

message
String

事件说明。

eventSource
Object

作为事件源的对象。

eventCode
Int32

与该事件关联的代码。 实现自定义事件时,事件代码必须大于 WebExtendedBase

eventDetailCode
Int32

事件的详细标识符。

e
Exception

与此错误关联的 Exception

示例

下面的代码示例演示如何从 类的 SampleWebBaseErrorEvent 构造函数(派生自 WebBaseErrorEvent 类的类)调用此构造函数。

// Invoked in case of events identified by their event code and 
// related event detailed code.
public SampleWebBaseErrorEvent(string msg, object eventSource, 
    int eventCode, int detailedCode, Exception e):
  base(msg, eventSource, eventCode, detailedCode, e)
{
    // Perform custom initialization.
    customCreatedMsg =
      string.Format("Event created at: {0}", 
      DateTime.Now.TimeOfDay.ToString());
}
' 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 detailedCode As Integer, _
ByVal e As Exception)
    MyBase.New(msg, eventSource, eventCode, detailedCode, e)
    ' Perform custom initialization.
    customCreatedMsg = String.Format("Event created at: {0}", _
    DateTime.Now.TimeOfDay.ToString())

End Sub

注解

此构造函数由 ASP.NET 运行状况监视系统在内部使用。 实现自己的从此类继承的事件类型时,可以调用此构造函数。

另请参阅

适用于