語言

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 例物件,但你可以在實作繼承自該類別的事件類型時呼叫這個建構子。

Note

建 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 例物件,但你可以在實作繼承自該類別的事件類型時呼叫這個建構子。

Note

建 WebAuthenticationSuccessAuditEvent 構子並非直接從你的程式碼中使用。 它被稱為 ASP.NET。 你可以在從WebAuthenticationSuccessAuditEvent類別推導時呼叫建WebAuthenticationSuccessAuditEvent構子。

適用於