_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.

属性

注解

此方法用于从非托管代码访问托管类,不应从托管代码调用。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.

适用于

另请参阅