共用方式為


WebAuthenticationFailureAuditEvent 建構函式

定義

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

多載

WebAuthenticationFailureAuditEvent(String, Object, Int32, String)

使用指定的事件參數,初始化 WebAuthenticationFailureAuditEvent 類別的新執行個體。

WebAuthenticationFailureAuditEvent(String, Object, Int32, Int32, String)

使用指定的事件參數,初始化 WebAuthenticationFailureAuditEvent 類別的新執行個體。

WebAuthenticationFailureAuditEvent(String, Object, Int32, String)

使用指定的事件參數,初始化 WebAuthenticationFailureAuditEvent 類別的新執行個體。

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

參數

message
String

事件描述。

eventSource
Object

做為事件來源的物件。

eventCode
Int32

與事件關聯的 WebEventCodes 值。

nameToAuthenticate
String

要驗證的使用者名稱。

範例

下列程式碼範例示範如何自訂此建構函式。

// Invoked in case of events identified only by 
// their event code.
public SampleWebAuthenticationFailureAuditEvent(
    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

備註

WebAuthenticationFailureAuditEvent 構函式並非直接從程式碼使用。 ASP.NET 會呼叫它。 您可以從 類別衍生 WebAuthenticationFailureAuditEvent 時呼叫 WebAuthenticationFailureAuditEvent 建構函式。

適用於

WebAuthenticationFailureAuditEvent(String, Object, Int32, Int32, String)

使用指定的事件參數,初始化 WebAuthenticationFailureAuditEvent 類別的新執行個體。

protected public:
 WebAuthenticationFailureAuditEvent(System::String ^ message, System::Object ^ eventSource, int eventCode, int eventDetailCode, System::String ^ nameToAuthenticate);
protected internal WebAuthenticationFailureAuditEvent (string message, object eventSource, int eventCode, int eventDetailCode, string nameToAuthenticate);
new System.Web.Management.WebAuthenticationFailureAuditEvent : string * obj * int * int * string -> System.Web.Management.WebAuthenticationFailureAuditEvent
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 SampleWebAuthenticationFailureAuditEvent(
    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

備註

WebAuthenticationFailureAuditEvent 構函式並非直接從程式碼使用。 ASP.NET 會呼叫它。 您可以從 類別衍生 WebAuthenticationFailureAuditEvent 時呼叫 WebAuthenticationFailureAuditEvent 建構函式。

適用於