HttpListenerException 建構函式

定義

初始化 HttpListenerException 類別的新執行個體。

多載

HttpListenerException()

初始化 HttpListenerException 類別的新執行個體。

HttpListenerException(Int32)

使用指定的錯誤碼,初始化 HttpListenerException 類別的新執行個體。

HttpListenerException(Int32, String)

使用指定的錯誤碼和訊息,初始化 HttpListenerException 類別的新執行個體。

HttpListenerException(SerializationInfo, StreamingContext)
已淘汰.

初始化 HttpListenerException 類別的新執行個體,這個執行個體是來自 SerializationInfoStreamingContext 類別的指定執行個體。

HttpListenerException()

來源:
HttpListenerException.cs
來源:
HttpListenerException.cs
來源:
HttpListenerException.cs

初始化 HttpListenerException 類別的新執行個體。

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

備註

此建構函式會使用最新的 Windows 錯誤來設定 ErrorCodeMessage 屬性。

適用於

HttpListenerException(Int32)

來源:
HttpListenerException.cs
來源:
HttpListenerException.cs
來源:
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)

來源:
HttpListenerException.cs
來源:
HttpListenerException.cs
來源:
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)

來源:
HttpListenerException.cs
來源:
HttpListenerException.cs
來源:
HttpListenerException.cs

警告

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

初始化 HttpListenerException 類別的新執行個體,這個執行個體是來自 SerializationInfoStreamingContext 類別的指定執行個體。

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 物件。

屬性

另請參閱

適用於