SerializationInfo.SetType(Type) 方法

定義

設定要序列化之物件的 Type

public:
 void SetType(Type ^ type);
public void SetType (Type type);
member this.SetType : Type -> unit
Public Sub SetType (type As Type)

參數

type
Type

要序列化的物件的 Type

例外狀況

type 參數為 null

備註

Formatter負責先設定 Type 實例的 SerializationInfo ,再將它傳遞至 GetObjectData 。 不過,想要為其物件傳送 Proxy 的使用者必須變更此 SerializationInfo 實例所代表的類型。 SetType使用 方法相當於設定 FullTypeNameAssemblyName

適用於