HttpListenerException Constructors

Definition

Initializes a new instance of the HttpListenerException class.

Overloads

HttpListenerException()

Initializes a new instance of the HttpListenerException class.

HttpListenerException(Int32)

Initializes a new instance of the HttpListenerException class using the specified error code.

HttpListenerException(Int32, String)

Initializes a new instance of the HttpListenerException class using the specified error code and message.

HttpListenerException(SerializationInfo, StreamingContext)
Obsolete.

Initializes a new instance of the HttpListenerException class from the specified instances of the SerializationInfo and StreamingContext classes.

HttpListenerException()

Initializes a new instance of the HttpListenerException class.

public:
 HttpListenerException();
public HttpListenerException ();
Public Sub New ()

Remarks

This constructor sets the ErrorCode and Message properties using the most recent Windows error.

Applies to

HttpListenerException(Int32)

Initializes a new instance of the HttpListenerException class using the specified error code.

public:
 HttpListenerException(int errorCode);
public HttpListenerException (int errorCode);
new System.Net.HttpListenerException : int -> System.Net.HttpListenerException
Public Sub New (errorCode As Integer)

Parameters

errorCode
Int32

A Int32 value that identifies the error that occurred.

Remarks

The value of errorCode is used to set the ErrorCode property.

Applies to

HttpListenerException(Int32, String)

Initializes a new instance of the HttpListenerException class using the specified error code and message.

public:
 HttpListenerException(int errorCode, System::String ^ message);
public HttpListenerException (int errorCode, string message);
new System.Net.HttpListenerException : int * string -> System.Net.HttpListenerException
Public Sub New (errorCode As Integer, message As String)

Parameters

errorCode
Int32

A Int32 value that identifies the error that occurred.

message
String

A String that describes the error that occurred.

Remarks

The value of errorCode is used to set the ErrorCode property. The message parameter is used to set the Message property.

Applies to

HttpListenerException(SerializationInfo, StreamingContext)

Caution

This API supports obsolete formatter-based serialization. It should not be called or extended by application code.

Initializes a new instance of the HttpListenerException class from the specified instances of the SerializationInfo and StreamingContext classes.

protected:
 HttpListenerException(System::Runtime::Serialization::SerializationInfo ^ serializationInfo, System::Runtime::Serialization::StreamingContext streamingContext);
protected HttpListenerException (System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext streamingContext);
[System.Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
protected HttpListenerException (System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext streamingContext);
new System.Net.HttpListenerException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Net.HttpListenerException
[<System.Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
new System.Net.HttpListenerException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Net.HttpListenerException
Protected Sub New (serializationInfo As SerializationInfo, streamingContext As StreamingContext)

Parameters

serializationInfo
SerializationInfo

A SerializationInfo object that contains the information required to deserialize the new HttpListenerException object.

streamingContext
StreamingContext

A StreamingContext object.

Attributes

See also

Applies to