HttpListenerException 构造函数

定义

初始化 HttpListenerException 类的新实例。

重载

HttpListenerException()

初始化 HttpListenerException 类的新实例。

HttpListenerException(Int32)

使用指定的错误代码初始化 HttpListenerException 类的新实例。

HttpListenerException(Int32, String)

使用指定的错误代码和信息初始化 HttpListenerException 类的新实例。

HttpListenerException(SerializationInfo, StreamingContext)
已过时.

HttpListenerExceptionSerializationInfo 类的指定实例初始化 StreamingContext 类的新实例。

HttpListenerException()

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

初始化 HttpListenerException 类的新实例。

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

注解

此构造函数使用最新的 Windows 错误设置 ErrorCodeMessage 属性。

适用于

HttpListenerException(Int32)

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

使用指定的错误代码初始化 HttpListenerException 类的新实例。

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

参数

errorCode
Int32

Int32 值,标识发生的错误。

注解

的值 errorCode 用于设置 ErrorCode 属性。

适用于

HttpListenerException(Int32, String)

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

使用指定的错误代码和信息初始化 HttpListenerException 类的新实例。

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)

参数

errorCode
Int32

Int32 值,标识发生的错误。

message
String

描述发生的错误的 String

注解

的值 errorCode 用于设置 ErrorCode 属性。 参数 message 用于设置 Message 属性。

适用于

HttpListenerException(SerializationInfo, StreamingContext)

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

注意

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

HttpListenerExceptionSerializationInfo 类的指定实例初始化 StreamingContext 类的新实例。

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)

参数

serializationInfo
SerializationInfo

一个 SerializationInfo 对象,包含反序列化新的 HttpListenerException 对象所需的信息。

streamingContext
StreamingContext

StreamingContext 对象。

属性

另请参阅

适用于