WebAuthenticationSuccessAuditEvent 建構函式

定義

初始化 WebAuthenticationSuccessAuditEvent 類別的新執行個體。

多載

WebAuthenticationSuccessAuditEvent(String, Object, Int32, String)

使用提供的參數來初始化 WebAuthenticationSuccessAuditEvent 類別。

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

使用提供的參數來初始化 WebSuccessAuditEvent 類別。

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 建構函式。

適用於