HttpListenerException 建構函式

定義

初始化 HttpListenerException 類別的新執行個體。Initializes a new instance of the HttpListenerException class.

多載

HttpListenerException()

初始化 HttpListenerException 類別的新執行個體。Initializes a new instance of the HttpListenerException class.

HttpListenerException(Int32)

使用指定的錯誤碼,初始化 HttpListenerException 類別的新執行個體。Initializes a new instance of the HttpListenerException class using the specified error code.

HttpListenerException(Int32, String)

使用指定的錯誤碼和訊息,初始化 HttpListenerException 類別的新執行個體。Initializes a new instance of the HttpListenerException class using the specified error code and message.

HttpListenerException(SerializationInfo, StreamingContext)

初始化 HttpListenerException 類別的新執行個體,這個執行個體是來自 SerializationInfoStreamingContext 類別的指定執行個體。Initializes a new instance of the HttpListenerException class from the specified instances of the SerializationInfo and StreamingContext classes.

HttpListenerException()

初始化 HttpListenerException 類別的新執行個體。Initializes a new instance of the HttpListenerException class.

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

備註

這個函式會ErrorCode使用Message最新的 Windows 錯誤來設定和屬性。This constructor sets the ErrorCode and Message properties using the most recent Windows error.

HttpListenerException(Int32)

使用指定的錯誤碼,初始化 HttpListenerException 類別的新執行個體。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)

參數

errorCode
Int32

Int32 值,識別發生的錯誤。A Int32 value that identifies the error that occurred.

備註

的值errorCode是用來ErrorCode設定屬性。The value of errorCode is used to set the ErrorCode property.

HttpListenerException(Int32, String)

使用指定的錯誤碼和訊息,初始化 HttpListenerException 類別的新執行個體。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)

參數

errorCode
Int32

Int32 值,識別發生的錯誤。A Int32 value that identifies the error that occurred.

message
String

String,描述發生的錯誤。A String that describes the error that occurred.

備註

的值errorCode是用來ErrorCode設定屬性。The value of errorCode is used to set the ErrorCode property. 參數是用來Message設定屬性。 messageThe message parameter is used to set the Message property.

HttpListenerException(SerializationInfo, StreamingContext)

初始化 HttpListenerException 類別的新執行個體,這個執行個體是來自 SerializationInfoStreamingContext 類別的指定執行個體。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);
new System.Net.HttpListenerException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Net.HttpListenerException

參數

serializationInfo
SerializationInfo

SerializationInfo 物件,包含將新的 HttpListenerException 執行個體還原序列化所需的資訊。A SerializationInfo object that contains the information required to deserialize the new HttpListenerException object.

streamingContext
StreamingContext

StreamingContext 物件。A StreamingContext object.

另請參閱

適用於