WebSuccessAuditEvent 构造函数

定义

初始化 WebSuccessAuditEvent 类的新实例。Initializes a new instance of the WebSuccessAuditEvent class.

重载

WebSuccessAuditEvent(String, Object, Int32)

使用所提供的参数初始化 WebSuccessAuditEvent 类的新实例。Initializes a new instance of the WebSuccessAuditEvent class using the supplied parameters.

WebSuccessAuditEvent(String, Object, Int32, Int32)

使用所提供的参数初始化 WebSuccessAuditEvent 类的新实例。Initializes a new instance of the WebSuccessAuditEvent class using the supplied parameters.

WebSuccessAuditEvent(String, Object, Int32)

使用所提供的参数初始化 WebSuccessAuditEvent 类的新实例。Initializes a new instance of the WebSuccessAuditEvent class using the supplied parameters.

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

参数

message
String

事件说明。The event description.

eventSource
Object

作为事件源的对象。The object that is the source of the event.

eventCode
Int32

与该事件关联的代码。The code associated with the event. 实现自定义事件时,事件代码必须大于 WebExtendedBaseWhen you implement a custom event, the event code must be greater than WebExtendedBase.

示例

下面的代码示例演示如何在类中调用此构造函数 SampleWebSuccessAuditEventThe following code example shows how to call this constructor in the SampleWebSuccessAuditEvent class. 此代码示例是为类提供的更大示例的一部分 WebSuccessAuditEventThis code example is part of a larger example provided for the WebSuccessAuditEvent class.

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

End Sub

注解

此构造函数由 ASP.NET health 监视系统在内部使用。This constructor is used internally by the ASP.NET health-monitoring system. 你永远不会使用它来实例化 WebSuccessAuditEvent 对象,但你可以在实现继承自此类的事件类型时调用此构造函数。You will never use it to instantiate a WebSuccessAuditEvent object, but you can call this constructor when implementing your own event type that inherits from this class.

备注

WebSuccessAuditEvent构造函数不应在代码中直接使用。The WebSuccessAuditEvent constructor is not intended to be used directly from your code. 它由 ASP.NET 调用。It is called by ASP.NET. WebSuccessAuditEvent从类派生时,可以调用构造函数 WebSuccessAuditEventYou can call the WebSuccessAuditEvent constructor when deriving from the WebSuccessAuditEvent class.

适用于

WebSuccessAuditEvent(String, Object, Int32, Int32)

使用所提供的参数初始化 WebSuccessAuditEvent 类的新实例。Initializes a new instance of the WebSuccessAuditEvent class using the supplied parameters.

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

参数

message
String

事件说明。The event description.

eventSource
Object

作为事件源的对象。The object that is the source of the event.

eventCode
Int32

与该事件关联的代码。The code associated with the event. 实现自定义事件时,事件代码必须大于 WebExtendedBaseWhen you implement a custom event, the event code must be greater than WebExtendedBase.

eventDetailCode
Int32

用于指定事件的详细标识符的 WebEventCodes 值。The WebEventCodes value that specifies the detailed identifier for the event.

示例

下面的代码示例演示如何在类中调用此构造函数 SampleWebSuccessAuditEventThe following code example shows how to call this constructor in the SampleWebSuccessAuditEvent class. 此代码示例是为类提供的更大示例的一部分 WebSuccessAuditEventThis code example is part of a larger example provided for the WebSuccessAuditEvent class.

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

End Sub


注解

此构造函数由 ASP.NET health 监视系统在内部使用。This constructor is used internally by the ASP.NET health-monitoring system. 你永远不会使用它来实例化 WebSuccessAuditEvent 对象,但你可以在实现继承自此类的事件类型时调用此构造函数。You will never use it to instantiate a WebSuccessAuditEvent object, but you can call this constructor when implementing your own event type that inherits from this class.

备注

WebSuccessAuditEvent构造函数不应在代码中直接使用。The WebSuccessAuditEvent constructor is not intended to be used directly from your code. 它由 ASP.NET 调用。It is called by ASP.NET. WebSuccessAuditEvent从类派生时,可以调用构造函数 WebSuccessAuditEventYou can call the WebSuccessAuditEvent constructor when deriving from the WebSuccessAuditEvent class.

适用于