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()

Source:
HttpListenerException.cs
Source:
HttpListenerException.cs
Source:
HttpListenerException.cs

Initializes a new instance of the HttpListenerException class.

C#
public HttpListenerException();

Remarks

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

Applies to

.NET 10 a ďalšie verzie
Produkt Verzie
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

HttpListenerException(Int32)

Source:
HttpListenerException.cs
Source:
HttpListenerException.cs
Source:
HttpListenerException.cs

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

C#
public HttpListenerException(int errorCode);

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

.NET 10 a ďalšie verzie
Produkt Verzie
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

HttpListenerException(Int32, String)

Source:
HttpListenerException.cs
Source:
HttpListenerException.cs
Source:
HttpListenerException.cs

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

C#
public HttpListenerException(int errorCode, string message);

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

.NET 10 a ďalšie verzie
Produkt Verzie
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

HttpListenerException(SerializationInfo, StreamingContext)

Source:
HttpListenerException.cs
Source:
HttpListenerException.cs
Source:
HttpListenerException.cs

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.

C#
[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);
C#
protected HttpListenerException(System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext 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

.NET 10 a ďalšie verzie
Produkt Verzie (Zastarané)
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7 (8, 9, 10)
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1