WebAuthenticationFailureAuditEvent 建構函式
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
初始化 WebAuthenticationFailureAuditEvent 類別的新執行個體。
多載
| 名稱 | Description |
|---|---|
| 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構子。