语言

WebAuthenticationSuccessAuditEvent 构造函数

定义

初始化 WebAuthenticationSuccessAuditEvent 类的新实例。

重载

WebAuthenticationSuccessAuditEvent(String, Object, Int32, String)

WebAuthenticationSuccessAuditEvent使用提供的参数初始化类。

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

参数

message
String

事件说明。

eventSource
Object

事件源的对象。

eventCode
Int32

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

nameToAuthenticate
String

经过身份验证的用户的名称。

示例

下面的代码示例演示如何自定义此构造函数。

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

End Sub

注解

此构造函数由 ASP.NET 运行状况监视系统在内部使用。 永远不会使用它来实例化对象 WebAuthenticationSuccessAuditEvent ,但在实现从此类继承的你自己的事件类型时,可以调用此构造函数。

注释

构造 WebAuthenticationSuccessAuditEvent 函数不打算直接从代码使用。 它由 ASP.NET 调用。 从类派生WebAuthenticationSuccessAuditEvent时,可以调用WebAuthenticationSuccessAuditEvent构造函数。

适用于

WebAuthenticationSuccessAuditEvent(String, Object, Int32, Int32, String)

WebSuccessAuditEvent使用提供的参数初始化类。

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

参数

message
String

事件说明。

eventSource
Object

事件源的对象。

eventCode
Int32

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

eventDetailCode
Int32

指定 WebEventCodes 事件的详细标识符的值。

nameToAuthenticate
String

经过身份验证的用户的名称。

示例

下面的代码示例演示如何自定义此构造函数。

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

End Sub

注解

此构造函数由 ASP.NET 运行状况监视系统在内部使用。 永远不会使用它来实例化对象 WebAuthenticationSuccessAuditEvent ,但在实现从此类继承的你自己的事件类型时,可以调用此构造函数。

注释

构造 WebAuthenticationSuccessAuditEvent 函数不打算直接从代码使用。 它由 ASP.NET 调用。 从类派生WebAuthenticationSuccessAuditEvent时,可以调用WebAuthenticationSuccessAuditEvent构造函数。

适用于