DataMisalignedException 類別

定義

從位址讀取資料單元,或將資料單元寫入位址時,若資料單元不是資料大小的倍數,就會擲回例外狀況 (Exception)。The exception that is thrown when a unit of data is read from or written to an address that is not a multiple of the data size. 此類別無法獲得繼承。This class cannot be inherited.

public ref class DataMisalignedException sealed : Exception
public ref class DataMisalignedException sealed : SystemException
public sealed class DataMisalignedException : Exception
public sealed class DataMisalignedException : SystemException
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
public sealed class DataMisalignedException : SystemException
type DataMisalignedException = class
    inherit Exception
type DataMisalignedException = class
    inherit SystemException
[<System.Runtime.InteropServices.ComVisible(true)>]
[<System.Serializable>]
type DataMisalignedException = class
    inherit SystemException
Public NotInheritable Class DataMisalignedException
Inherits Exception
Public NotInheritable Class DataMisalignedException
Inherits SystemException
繼承
DataMisalignedException
繼承
DataMisalignedException
屬性

備註

某些微處理器(例如64位處理器)可在資料被讀取或寫入至不當的位址時發出硬體例外 (也就是當地址不是) 存取的資料大小的倍數時。Some microprocessors, such as 64-bit processors, can issue hardware exceptions when data is read or written to a misaligned address (that is, when an address is not a multiple of the size of the data being accessed). DataMisalignedException 當將16位、32位或64位資料讀取或寫入至不是兩個、四個或八個位元組的倍數的位址時,通常會擲回。DataMisalignedException is typically thrown when 16-bit, 32-bit, or 64-bit data is read from or written to an address that is not a multiple of two, four, or eight bytes.

DataMisalignedException會公開基礎硬體例外狀況,可讓您以適當的方式回應。The DataMisalignedException exposes the underlying hardware exception, which allows you to respond in an appropriate manner. 例如,應用程式中的常式會嘗試將位元組序列從一個位置複製到另一個位置(以64位單位)。For example, a routine in your application attempts to copy a sequence of bytes from one location to another in 64-bit units. 但是,寫入作業會從不當的位址開始,而導致 common language runtime 擲回 DataMisalignedExceptionHowever, the write operation starts at a misaligned address, which causes the common language runtime to throw a DataMisalignedException. 您的常式會將資料一次複製一個位元組來回應例外狀況。Your routine responds to the exception by copying the data one byte at a time.

建構函式

DataMisalignedException()

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

DataMisalignedException(String)

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

DataMisalignedException(String, Exception)

使用指定的錯誤訊息和基礎例外狀況來初始化 DataMisalignedException 類別的新執行個體。Initializes a new instance of the DataMisalignedException class using the specified error message and underlying exception.

屬性

Data

取得鍵值組的集合,這些鍵值組會提供關於例外狀況的其他使用者定義資訊。Gets a collection of key/value pairs that provide additional user-defined information about the exception.

(繼承來源 Exception)
HelpLink

取得或設定與這個例外狀況相關聯的說明檔連結。Gets or sets a link to the help file associated with this exception.

(繼承來源 Exception)
HResult

取得或設定 HRESULT,它是指派給特定例外狀況的編碼數值。Gets or sets HRESULT, a coded numerical value that is assigned to a specific exception.

(繼承來源 Exception)
InnerException

取得造成目前例外狀況的 Exception 執行個體。Gets the Exception instance that caused the current exception.

(繼承來源 Exception)
Message

取得描述目前例外狀況的訊息。Gets a message that describes the current exception.

(繼承來源 Exception)
Source

取得或設定造成錯誤的應用程式或物件的名稱。Gets or sets the name of the application or the object that causes the error.

(繼承來源 Exception)
StackTrace

取得呼叫堆疊上即時運算框架的字串表示。Gets a string representation of the immediate frames on the call stack.

(繼承來源 Exception)
TargetSite

取得擲回目前例外狀況的方法。Gets the method that throws the current exception.

(繼承來源 Exception)

方法

Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(繼承來源 Object)
GetBaseException()

在衍生類別中覆寫時,傳回一或多個後續的例外狀況的根本原因 ExceptionWhen overridden in a derived class, returns the Exception that is the root cause of one or more subsequent exceptions.

(繼承來源 Exception)
GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(繼承來源 Object)
GetObjectData(SerializationInfo, StreamingContext)

在衍生類別中覆寫時,使用例外狀況的資訊設定 SerializationInfoWhen overridden in a derived class, sets the SerializationInfo with information about the exception.

(繼承來源 Exception)
GetType()

取得目前執行個體的執行階段類型。Gets the runtime type of the current instance.

(繼承來源 Exception)
MemberwiseClone()

建立目前 Object 的淺層複製。Creates a shallow copy of the current Object.

(繼承來源 Object)
ToString()

建立並傳回目前例外狀況的字串表示。Creates and returns a string representation of the current exception.

(繼承來源 Exception)

事件

SerializeObjectState

當例外狀況序列化,以建立包含例外狀況相關序列化資料的例外狀況狀態物件時,就會發生此事件。Occurs when an exception is serialized to create an exception state object that contains serialized data about the exception.

(繼承來源 Exception)

適用於