Win32Exception Win32Exception Win32Exception Win32Exception Constructors

定義

多載

Win32Exception() Win32Exception() Win32Exception()

使用最後發生的 Win32 錯誤,初始化 Win32Exception 類別的新執行個體。Initializes a new instance of the Win32Exception class with the last Win32 error that occurred.

Win32Exception(Int32) Win32Exception(Int32) Win32Exception(Int32) Win32Exception(Int32)

使用指定的錯誤來初始化 Win32Exception 類別的新執行個體。Initializes a new instance of the Win32Exception class with the specified error.

Win32Exception(String) Win32Exception(String) Win32Exception(String) Win32Exception(String)

使用指定的詳細描述來初始化 Win32Exception 類別的新執行個體。Initializes a new instance of the Win32Exception class with the specified detailed description.

Win32Exception(Int32, String) Win32Exception(Int32, String) Win32Exception(Int32, String) Win32Exception(Int32, String)

使用指定的錯誤和指定的詳細描述來初始化 Win32Exception 類別的新執行個體。Initializes a new instance of the Win32Exception class with the specified error and the specified detailed description.

Win32Exception(SerializationInfo, StreamingContext) Win32Exception(SerializationInfo, StreamingContext) Win32Exception(SerializationInfo, StreamingContext) Win32Exception(SerializationInfo, StreamingContext)

使用指定的內容和序列化 (Serialization) 資訊,初始化 Win32Exception 類別的新執行個體。Initializes a new instance of the Win32Exception class with the specified context and the serialization information.

Win32Exception(String, Exception) Win32Exception(String, Exception) Win32Exception(String, Exception) Win32Exception(String, Exception)

使用指定的詳細描述和指定的例外狀況,初始化 Win32Exception 類別的新執行個體。Initializes a new instance of the Win32Exception class with the specified detailed description and the specified exception.

Win32Exception() Win32Exception() Win32Exception()

使用最後發生的 Win32 錯誤,初始化 Win32Exception 類別的新執行個體。Initializes a new instance of the Win32Exception class with the last Win32 error that occurred.

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

備註

錯誤的詳細描述將由與錯誤相關聯的 Win32 錯誤訊息決定。The detailed description of the error will be determined by the Win32 error message associated with the error.

這個函式會GetLastWin32Error使用的Marshal方法來取得其錯誤碼。This constructor uses the GetLastWin32Error method of Marshal to get its error code.

安全性

SecurityPermission
用於存取未受管理的程式碼。for access to unmanaged code. 相關聯的列舉:UnmanagedCodeAssociated enumeration: UnmanagedCode

Win32Exception(Int32) Win32Exception(Int32) Win32Exception(Int32) Win32Exception(Int32)

使用指定的錯誤來初始化 Win32Exception 類別的新執行個體。Initializes a new instance of the Win32Exception class with the specified error.

public:
 Win32Exception(int error);
public Win32Exception (int error);
new System.ComponentModel.Win32Exception : int -> System.ComponentModel.Win32Exception
Public Sub New (error As Integer)

參數

error
Int32 Int32 Int32 Int32

與這個例外狀況關聯的 Win32 錯誤碼。The Win32 error code associated with this exception.

備註

錯誤的詳細描述是由與錯誤相關聯的 Win32 錯誤訊息所決定。The detailed description of the error is determined by the Win32 error message associated with the error.

安全性

SecurityPermission
用於存取未受管理的程式碼。for access to unmanaged code. 相關聯的列舉:UnmanagedCodeAssociated enumeration: UnmanagedCode

Win32Exception(String) Win32Exception(String) Win32Exception(String) Win32Exception(String)

使用指定的詳細描述來初始化 Win32Exception 類別的新執行個體。Initializes a new instance of the Win32Exception class with the specified detailed description.

public:
 Win32Exception(System::String ^ message);
public Win32Exception (string message);
new System.ComponentModel.Win32Exception : string -> System.ComponentModel.Win32Exception
Public Sub New (message As String)

參數

message
String String String String

錯誤的詳細描述。A detailed description of the error.

安全性

SecurityPermission
用於存取未受管理的程式碼。for access to unmanaged code. 相關聯的列舉:UnmanagedCodeAssociated enumeration: UnmanagedCode

Win32Exception(Int32, String) Win32Exception(Int32, String) Win32Exception(Int32, String) Win32Exception(Int32, String)

使用指定的錯誤和指定的詳細描述來初始化 Win32Exception 類別的新執行個體。Initializes a new instance of the Win32Exception class with the specified error and the specified detailed description.

public:
 Win32Exception(int error, System::String ^ message);
public Win32Exception (int error, string message);
new System.ComponentModel.Win32Exception : int * string -> System.ComponentModel.Win32Exception
Public Sub New (error As Integer, message As String)

參數

error
Int32 Int32 Int32 Int32

與這個例外狀況關聯的 Win32 錯誤碼。The Win32 error code associated with this exception.

message
String String String String

錯誤的詳細描述。A detailed description of the error.

備註

錯誤的詳細描述是由與錯誤相關聯的 Win32 錯誤訊息所決定。The detailed description of the error is determined by the Win32 error message associated with the error.

安全性

SecurityPermission
用於存取未受管理的程式碼。for access to unmanaged code. 相關聯的列舉:UnmanagedCodeAssociated enumeration: UnmanagedCode

Win32Exception(SerializationInfo, StreamingContext) Win32Exception(SerializationInfo, StreamingContext) Win32Exception(SerializationInfo, StreamingContext) Win32Exception(SerializationInfo, StreamingContext)

使用指定的內容和序列化 (Serialization) 資訊,初始化 Win32Exception 類別的新執行個體。Initializes a new instance of the Win32Exception class with the specified context and the serialization information.

protected:
 Win32Exception(System::Runtime::Serialization::SerializationInfo ^ info, System::Runtime::Serialization::StreamingContext context);
protected Win32Exception (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
new System.ComponentModel.Win32Exception : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.ComponentModel.Win32Exception
Protected Sub New (info As SerializationInfo, context As StreamingContext)

參數

info
SerializationInfo SerializationInfo SerializationInfo SerializationInfo

與這個例外狀況關聯的 SerializationInfoThe SerializationInfo associated with this exception.

context
StreamingContext StreamingContext StreamingContext StreamingContext

StreamingContext,表示這個例外狀況的內容。A StreamingContext that represents the context of this exception.

安全性

CodeAccessPermission
用於存取未受管理的程式碼。for access to unmanaged code. 相關聯的列舉:UnmanagedCodeAssociated enumeration: UnmanagedCode

Win32Exception(String, Exception) Win32Exception(String, Exception) Win32Exception(String, Exception) Win32Exception(String, Exception)

使用指定的詳細描述和指定的例外狀況,初始化 Win32Exception 類別的新執行個體。Initializes a new instance of the Win32Exception class with the specified detailed description and the specified exception.

public:
 Win32Exception(System::String ^ message, Exception ^ innerException);
public Win32Exception (string message, Exception innerException);
new System.ComponentModel.Win32Exception : string * Exception -> System.ComponentModel.Win32Exception
Public Sub New (message As String, innerException As Exception)

參數

message
String String String String

錯誤的詳細描述。A detailed description of the error.

innerException
Exception Exception Exception Exception

造成這個例外狀況之內部例外狀況的參考。A reference to the inner exception that is the cause of this exception.

安全性

SecurityPermission
用於存取未受管理的程式碼。for access to unmanaged code. 相關聯的列舉:UnmanagedCodeAssociated enumeration: UnmanagedCode

適用於