WebRequestErrorEvent Construtores
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Inicializa uma nova instância da WebRequestErrorEvent classe.
Sobrecargas
| Name | Description |
|---|---|
| WebRequestErrorEvent(String, Object, Int32, Exception) |
Inicializa a WebRequestErrorEvent classe com parâmetros de evento especificados. |
| WebRequestErrorEvent(String, Object, Int32, Int32, Exception) |
Inicializa a WebRequestErrorEvent classe com parâmetros de evento especificados. |
Observações
O valor que usa para definir o seu código de evento ou identificador deve ser maior do que a WebExtendedBase constante do campo.
WebRequestErrorEvent(String, Object, Int32, Exception)
Inicializa a WebRequestErrorEvent classe com 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 fonte do evento.
- eventCode
- Int32
O identificador associado ao evento. Deve ser maior do que a WebExtendedBase constante de campo.
Exemplos
O seguinte exemplo de código mostra como usar este 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
Observações
Este construtor permite-lhe criar um WebRequestErrorEvent evento sem precisar de especificar informações detalhadas do código sobre o próprio evento.
Aplica-se a
WebRequestErrorEvent(String, Object, Int32, Int32, Exception)
Inicializa a WebRequestErrorEvent classe com 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 fonte do evento.
- eventCode
- Int32
O identificador associado ao evento. Deve ser maior do que WebExtendedBase a constante de campo.
- eventDetailCode
- Int32
O identificador do código de detalhe do evento.
Exemplos
O seguinte exemplo de código mostra como usar este 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
Observações
Use este construtor se precisar de especificar informações detalhadas do código sobre o evento.