Compartilhar via


WebRequestErrorEvent Construtores

Definição

Inicializa uma nova instância da classe WebRequestErrorEvent.

Sobrecargas

WebRequestErrorEvent(String, Object, Int32, Exception)

Inicializa a classe WebRequestErrorEvent com os parâmetros de evento especificados.

WebRequestErrorEvent(String, Object, Int32, Int32, Exception)

Inicializa a classe WebRequestErrorEvent com os parâmetros de evento especificados.

Comentários

O valor que você usa para definir seu código de evento ou identificador deve ser maior que a constante de WebExtendedBase campo.

WebRequestErrorEvent(String, Object, Int32, Exception)

Inicializa a classe WebRequestErrorEvent com os parâmetros de evento especificados.

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

Parâmetros

message
String

A descrição do evento.

eventSource
Object

O objeto que é a origem do evento.

eventCode
Int32

O identificador associado ao evento. Deve ser maior que a constante do campo WebExtendedBase.

exception
Exception

A Exception associada ao erro.

Exemplos

O exemplo de código a seguir mostra como usar esse construtor.

// Invoked in case of events 
// identified only by their event code.
public SampleWebRequestErrorEvent(string msg, 
    object eventSource, int eventCode, 
    Exception e):
  base(msg, eventSource, eventCode, e)
{
    // Perform custom initialization.
    eventInfo = new StringBuilder();
    eventInfo.Append(string.Format(
        "Event created at: ", EventTime.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 e As Exception)
     MyBase.New(msg, eventSource, _
     eventCode, e)
     ' Perform custom initialization.
     eventInfo = New StringBuilder()
     eventInfo.Append(String.Format( _
     "Event created at: ", _
     EventTime.ToString()))
 End Sub

Comentários

Esse construtor permite que você crie um WebRequestErrorEvent evento sem a necessidade de especificar informações detalhadas de código sobre o evento em si.

Aplica-se a

WebRequestErrorEvent(String, Object, Int32, Int32, Exception)

Inicializa a classe WebRequestErrorEvent com os parâmetros de evento especificados.

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

Parâmetros

message
String

A descrição do evento.

eventSource
Object

O objeto que é a origem do evento.

eventCode
Int32

O identificador associado ao evento. Deve ser maior que a constante do campo WebExtendedBase.

eventDetailCode
Int32

O identificador de código de detalhes do evento.

exception
Exception

A Exception associada ao erro.

Exemplos

O exemplo de código a seguir mostra como usar esse construtor.

// Invoked in case of events identified 
// by their event code.and related event 
// detailed code.
public SampleWebRequestErrorEvent(
    string msg, object eventSource, 
    int eventCode, int detailedCode, 
    Exception e):
  base(msg, eventSource, 
    eventCode, detailedCode, e)
{
    // Perform custom initialization.
    eventInfo = new StringBuilder();
    eventInfo.Append(string.Format(
        "Event created at: ", EventTime.ToString()));
}
' Invoked in case of events identified 
' by their event code.and related event 
' detailed code.
 Public Sub New(ByVal msg As String, _
 ByVal eventSource As Object, _
 ByVal eventCode As Integer, _
 ByVal detailedCode As Integer, _
 ByVal e As Exception)
     MyBase.New(msg, eventSource, _
     eventCode, detailedCode, e)
     ' Perform custom initialization.
     eventInfo = New StringBuilder()
     eventInfo.Append(String.Format( _
     "Event created at: ", _
     EventTime.ToString()))
 End Sub

Comentários

Use esse construtor se precisar especificar informações detalhadas sobre o evento.

Aplica-se a