ArgumentException.GetObjectData(SerializationInfo, StreamingContext) Method

Definition

设置带有参数名和附加异常信息的 SerializationInfo 对象。Sets the SerializationInfo object with the parameter name and additional exception information.

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

Parameters

info
SerializationInfo

包含序列化对象数据的对象。The object that holds the serialized object data.

context
StreamingContext

与源或目标有关的上下文信息。The contextual information about the source or destination.

Implements

Attributes

Exceptions

info 对象是空引用(在 Visual Basic 中为 Nothing)。The info object is a null reference (Nothing in Visual Basic).

Remarks

GetObjectData 会设置 SerializationInfo,对所有异常对象数据进行序列化。GetObjectData sets a SerializationInfo with all the exception object data targeted for serialization. 在反序列化期间,将从通过流传输 SerializationInfo 重建异常对象。During deserialization, the exception object is reconstituted from the SerializationInfo transmitted over the stream.

有关详细信息,请参阅 SerializationInfoFor more information, see SerializationInfo.

Applies to

See also