共用方式為


ArgumentException.GetObjectData(SerializationInfo, StreamingContext) 方法

定義

警告

This API supports obsolete formatter-based serialization. It should not be called or extended by application code.

設定具有參數名稱和額外例外狀況資訊的 SerializationInfo 物件。

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.Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
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
[<System.Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
override this.GetObjectData : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> unit
[<System.Security.SecurityCritical>]
override this.GetObjectData : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> unit
Public Overrides Sub GetObjectData (info As SerializationInfo, context As StreamingContext)

參數

info
SerializationInfo

存放序列物件資料的物件。

context
StreamingContext

關於來源或目的端的內容資訊。

實作

屬性

例外狀況

info 物件為 Null 參考 (在 Visual Basic 中為 Nothing)。

備註

GetObjectData 會以目標為序列化的所有例外狀況物件資料設定 SerializationInfo。 在還原序列化期間,例外狀況物件會從透過 SerializationInfo 資料流程傳輸的 重新建構。

如需詳細資訊,請參閱SerializationInfo

適用於

另請參閱