WebAuthenticationFailureAuditEvent Klasa
Definicja
Ważny
Niektóre informacje dotyczą produktów przedpremierowych, które mogą zostać znacznie zmodyfikowane przed premierą. Microsoft nie udziela żadnych gwarancji, ani wyraźnych, ani domniemanych, dotyczących informacji podanych tutaj.
Zawiera informacje o błędach uwierzytelniania ASP.NET.
public ref class WebAuthenticationFailureAuditEvent : System::Web::Management::WebFailureAuditEvent
public class WebAuthenticationFailureAuditEvent : System.Web.Management.WebFailureAuditEvent
type WebAuthenticationFailureAuditEvent = class
inherit WebFailureAuditEvent
Public Class WebAuthenticationFailureAuditEvent
Inherits WebFailureAuditEvent
- Dziedziczenie
-
WebAuthenticationFailureAuditEvent
Przykłady
W poniższym przykładzie kodu pokazano, jak używać WebAuthenticationFailureAuditEvent klasy .
using System;
using System.Text;
using System.Web;
using System.Web.Management;
namespace SamplesAspNet
{
// Implements a custom WebAuthenticationFailureAuditEvent class.
public class SampleWebAuthenticationFailureAuditEvent :
System.Web.Management.WebAuthenticationFailureAuditEvent
{
private string customCreatedMsg, customRaisedMsg;
// 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 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());
}
// Raises the SampleWebAuthenticationFailureAuditEvent.
public override void Raise()
{
// Perform custom processing.
customRaisedMsg =
string.Format("Event raised at: {0}",
DateTime.Now.TimeOfDay.ToString());
// Raise the event.
WebBaseEvent.Raise(this);
}
// Obtains the current thread information.
public WebRequestInformation GetRequestInformation()
{
// No customization is allowed.
return RequestInformation;
}
//Formats Web request event information.
//This method is invoked indirectly by the provider
//using one of the overloaded ToString methods.
public override void FormatCustomEventDetails(WebEventFormatter formatter)
{
base.FormatCustomEventDetails(formatter);
// Add custom data.
formatter.AppendLine("");
formatter.IndentationLevel += 1;
formatter.AppendLine(
"* SampleWebAuthenticationFailureAuditEvent Start *");
formatter.AppendLine(string.Format("Request path: {0}",
RequestInformation.RequestPath));
formatter.AppendLine(string.Format("Request Url: {0}",
RequestInformation.RequestUrl));
// Display custom event timing.
formatter.AppendLine(customCreatedMsg);
formatter.AppendLine(customRaisedMsg);
formatter.AppendLine(
"* SampleWebAuthenticationFailureAuditEvent End *");
formatter.IndentationLevel -= 1;
}
}
}
Imports System.Text
Imports System.Web
Imports System.Web.Management
' Implements a custom WebAuthenticationFailureAuditEvent class.
Public Class SampleWebAuthenticationFailureAuditEvent
Inherits System.Web.Management.WebAuthenticationFailureAuditEvent
Private customCreatedMsg, customRaisedMsg As String
' 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
' 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
' Raises the SampleWebAuthenticationFailureAuditEvent.
Public Overrides Sub Raise()
' Perform custom processing.
customRaisedMsg = String.Format( _
"Event raised at: {0}", _
DateTime.Now.TimeOfDay.ToString())
' Raise the event.
WebBaseEvent.Raise(Me)
End Sub
' Obtains the current thread information.
Public Function GetRequestInformation() _
As WebRequestInformation
' No customization is allowed.
Return RequestInformation
End Function 'GetRequestInformation
'Formats Web request event information.
'This method is invoked indirectly by the provider
'using one of the overloaded ToString methods.
Public Overrides Sub FormatCustomEventDetails(ByVal formatter _
As WebEventFormatter)
MyBase.FormatCustomEventDetails(formatter)
' Add custom data.
formatter.AppendLine("")
formatter.IndentationLevel += 1
formatter.AppendLine( _
"* SampleWebAuthenticationFailureAuditEvent Start *")
formatter.AppendLine( _
String.Format("Request path: {0}", _
RequestInformation.RequestPath))
formatter.AppendLine( _
String.Format("Request Url: {0}", _
RequestInformation.RequestUrl))
' Display custom event timing.
formatter.AppendLine(customCreatedMsg)
formatter.AppendLine(customRaisedMsg)
formatter.AppendLine( _
"* SampleWebAuthenticationFailureAuditEvent End *")
formatter.IndentationLevel -= 1
End Sub
End Class
Uwagi
Poniższa lista zawiera opis funkcji, dla których WebAuthenticationFailureAuditEvent zdarzenia są domyślnie wywoływane przez ASP.NET.
Uwaga
Domyślnie ASP.NET jest skonfigurowany do rejestrowania tylko warunków niepowodzenia inspekcji, ponieważ warunki powodzenia rejestrowania mogą poważnie obciążać zasoby systemowe. Zawsze można skonfigurować system do rejestrowania warunków powodzenia.
Uwierzytelnianie formularzy. Inspekcje powodzenia obejmują nazwę użytkownika, która została uwierzytelniona; inspekcje niepowodzeń nie zawierają nazwy użytkownika, ponieważ zazwyczaj wynikają one z biletu, który zakończył się niepowodzeniem odszyfrowywania lub walidacji. Oba zawierają adres IP klienta. Powiązany kod inspekcji zdarzeń to AuditFormsAuthenticationFailure.
Członkostwa. Inspekcje powodzenia i niepowodzenia zawierają nazwę użytkownika, która została podjęta. Żadna forma inspekcji nie będzie zawierać hasła, które próbowano podjąć, ponieważ może to spowodować utrwalone prawidłowe hasło w dzienniku. Powiązany kod inspekcji zdarzeń to AuditMembershipAuthenticationFailure.
Gdy element WebAuthenticationFailureAuditEvent zostanie zgłoszony, domyślnie aktualizuje on licznik wydajności Inspekcja zdarzeń niepowodzenia uwierzytelniania. Aby wyświetlić ten licznik wydajności w monitorze systemu (PerfMon), w oknie Dodawanie liczników wybierz ASP.NET z listy rozwijanej Obiekt wydajności , wybierz licznik zdarzeń niepowodzenia uwierzytelniania podniósł licznik wydajności, a następnie kliknij przycisk Dodaj . Aby uzyskać więcej informacji, zobacz Using the System Monitor (PerfMon) with ASP.NET Applications (Używanie monitora systemu (PerfMon) z aplikacjami ASP.NET.
Uwaga
W większości przypadków będzie można użyć ASP.NET typów monitorowania kondycji zgodnie z implementacją i będziesz kontrolować system monitorowania kondycji, określając wartości w healthMonitoring sekcji konfiguracji. Możesz również pochodzić z typów monitorowania kondycji, aby utworzyć własne niestandardowe zdarzenia i dostawców. Przykład wyprowadzania z klasy można znaleźć w przykładzie WebAuthenticationFailureAuditEvent podanym w tym temacie.
Konstruktorów
| Nazwa | Opis |
|---|---|
| WebAuthenticationFailureAuditEvent(String, Object, Int32, Int32, String) |
Inicjuje WebAuthenticationFailureAuditEvent nowe wystąpienie klasy z określonymi parametrami zdarzenia. |
| WebAuthenticationFailureAuditEvent(String, Object, Int32, String) |
Inicjuje WebAuthenticationFailureAuditEvent nowe wystąpienie klasy z określonymi parametrami zdarzenia. |
Właściwości
| Nazwa | Opis |
|---|---|
| EventCode |
Pobiera wartość kodu skojarzona ze zdarzeniem. (Dziedziczone od WebBaseEvent) |
| EventDetailCode |
Pobiera kod szczegółów zdarzenia. (Dziedziczone od WebBaseEvent) |
| EventID |
Pobiera identyfikator skojarzony ze zdarzeniem. (Dziedziczone od WebBaseEvent) |
| EventOccurrence |
Pobiera licznik reprezentujący liczbę przypadków wystąpienia zdarzenia. (Dziedziczone od WebBaseEvent) |
| EventSequence |
Pobiera liczbę przypadków zgłoszenia zdarzenia przez aplikację. (Dziedziczone od WebBaseEvent) |
| EventSource |
Pobiera obiekt, który zgłasza zdarzenie. (Dziedziczone od WebBaseEvent) |
| EventTime |
Pobiera czas zgłoszenia zdarzenia. (Dziedziczone od WebBaseEvent) |
| EventTimeUtc |
Pobiera czas zgłoszenia zdarzenia. (Dziedziczone od WebBaseEvent) |
| Message |
Pobiera komunikat opisujący zdarzenie. (Dziedziczone od WebBaseEvent) |
| NameToAuthenticate |
Pobiera nazwę użytkownika do uwierzytelnienia. |
| ProcessInformation |
Pobiera informacje o ASP.NET procesie hostingu aplikacji. (Dziedziczone od WebManagementEvent) |
| RequestInformation |
Pobierz informacje skojarzone z żądaniem internetowym. (Dziedziczone od WebAuditEvent) |
Metody
| Nazwa | Opis |
|---|---|
| Equals(Object) |
Określa, czy dany obiekt jest taki sam, jak bieżący obiekt. (Dziedziczone od Object) |
| FormatCustomEventDetails(WebEventFormatter) |
Zapewnia standardowe formatowanie informacji o zdarzeniu. (Dziedziczone od WebBaseEvent) |
| GetHashCode() |
Służy jako domyślna funkcja skrótu. (Dziedziczone od Object) |
| GetType() |
Type Pobiera wartość bieżącego wystąpienia. (Dziedziczone od Object) |
| IncrementPerfCounters() |
Zwiększa liczbę zgłoszonych liczników wydajności zdarzeń niepowodzeń inspekcji. (Dziedziczone od WebFailureAuditEvent) |
| MemberwiseClone() |
Tworzy płytkią kopię bieżącego Objectelementu . (Dziedziczone od Object) |
| Raise() |
Zgłasza zdarzenie, powiadamiając każdego skonfigurowanego dostawcę o wystąpieniu zdarzenia. (Dziedziczone od WebBaseEvent) |
| ToString() |
Formatuje informacje o zdarzeniach do celów wyświetlania. (Dziedziczone od WebBaseEvent) |
| ToString(Boolean, Boolean) |
Formatuje informacje o zdarzeniach do celów wyświetlania. (Dziedziczone od WebBaseEvent) |