แก้ไข

แชร์ผ่าน


WebRequestErrorEvent Constructors

Definition

Initializes a new instance of the WebRequestErrorEvent class.

Overloads

WebRequestErrorEvent(String, Object, Int32, Exception)

Initializes the WebRequestErrorEvent class with specified event parameters.

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

Initializes the WebRequestErrorEvent class with specified event parameters.

Remarks

The value you use to define your event code or identifier must be greater than the WebExtendedBase field constant.

WebRequestErrorEvent(String, Object, Int32, Exception)

Initializes the WebRequestErrorEvent class with specified event parameters.

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)

Parameters

message
String

The event description.

eventSource
Object

The object that is the source of the event.

eventCode
Int32

The identifier associated with the event. It must be greater than the WebExtendedBase field constant.

exception
Exception

The Exception associated with the error.

Examples

The following code example shows how to use this constructor.

// 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

Remarks

This constructor allows you to create a WebRequestErrorEvent event without needing to specify detailed code information about the event itself.

Applies to

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

Initializes the WebRequestErrorEvent class with specified event parameters.

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)

Parameters

message
String

The event description.

eventSource
Object

The object that is the source of the event.

eventCode
Int32

The identifier associated with the event. It must be greater than WebExtendedBase field constant.

eventDetailCode
Int32

The event detail code identifier.

exception
Exception

The Exception associated with the error.

Examples

The following code example shows how to use this constructor.

// 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

Remarks

Use this constructor if you need to specify detailed code information about the event.

Applies to