_Exception.GetObjectData(SerializationInfo, StreamingContext) 方法

定義

為 COM 物件提供與版本無關的 GetObjectData(SerializationInfo, StreamingContext) 方法之存取權。Provides COM objects with version-independent access to the GetObjectData(SerializationInfo, StreamingContext) method.

public:
 void GetObjectData(System::Runtime::Serialization::SerializationInfo ^ info, System::Runtime::Serialization::StreamingContext context);
public void GetObjectData (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
[System.Security.SecurityCritical]
public void GetObjectData (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
abstract member GetObjectData : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> unit
Public Sub GetObjectData (info As SerializationInfo, context As StreamingContext)

參數

info
SerializationInfo

SerializationInfo 物件,其中保存所擲回之例外狀況的相關序列化物件資料。The SerializationInfo object that holds the serialized object data about the exception being thrown.

context
StreamingContext

StreamingContext 結構,包含關於來源或目的端的內容資訊。The StreamingContext structure that contains contextual information about the source or destination.

屬性

備註

這個方法是用來從非受控程式碼存取 managed 類別,而且不應該從 managed 程式碼呼叫。This method is for access to managed classes from unmanaged code and should not be called from managed code.

Exception.GetObjectData 方法會使用例外狀況的相關資訊來設定 SerializationInfo 物件。The Exception.GetObjectData method sets the SerializationInfo object with information about the exception.

適用於

另請參閱