Formatter.Serialize(Stream, Object) 方法

定義

警告

BinaryFormatter serialization is obsolete and should not be used. See https://aka.ms/binaryformatter for more information.

當覆寫於衍生類別時,使用已附加於格式子的資料流指定根 (Root),序列化物件的 Graph。

public:
 abstract void Serialize(System::IO::Stream ^ serializationStream, System::Object ^ graph);
[System.Obsolete("BinaryFormatter serialization is obsolete and should not be used. See https://aka.ms/binaryformatter for more information.", DiagnosticId="SYSLIB0011", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public abstract void Serialize (System.IO.Stream serializationStream, object graph);
public abstract void Serialize (System.IO.Stream serializationStream, object graph);
[<System.Obsolete("BinaryFormatter serialization is obsolete and should not be used. See https://aka.ms/binaryformatter for more information.", DiagnosticId="SYSLIB0011", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
abstract member Serialize : System.IO.Stream * obj -> unit
abstract member Serialize : System.IO.Stream * obj -> unit
Public MustOverride Sub Serialize (serializationStream As Stream, graph As Object)

參數

serializationStream
Stream

物件要序列化的目的資料流。

graph
Object

物件,位在要序列化的 Graph 的根。

實作

屬性

給實施者的注意事項

您必須在衍生類別中實作這個方法。

適用於

另請參閱