BinaryFormatter Klasa

Definicja

Przestroga

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

Serializuje i deserializuje obiekt lub cały graf połączonych obiektów w formacie binarnym.

public ref class BinaryFormatter sealed : System::Runtime::Serialization::IFormatter
public ref class BinaryFormatter sealed : System::Runtime::Remoting::Messaging::IRemotingFormatter
public sealed class BinaryFormatter : System.Runtime.Serialization.IFormatter
[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 sealed class BinaryFormatter : System.Runtime.Serialization.IFormatter
public sealed class BinaryFormatter : System.Runtime.Remoting.Messaging.IRemotingFormatter
[System.Runtime.InteropServices.ComVisible(true)]
public sealed class BinaryFormatter : System.Runtime.Remoting.Messaging.IRemotingFormatter
type BinaryFormatter = class
    interface IFormatter
[<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}")>]
type BinaryFormatter = class
    interface IFormatter
type BinaryFormatter = class
    interface IRemotingFormatter
    interface IFormatter
[<System.Runtime.InteropServices.ComVisible(true)>]
type BinaryFormatter = class
    interface IRemotingFormatter
    interface IFormatter
Public NotInheritable Class BinaryFormatter
Implements IFormatter
Public NotInheritable Class BinaryFormatter
Implements IRemotingFormatter
Dziedziczenie
BinaryFormatter
Atrybuty
Implementuje

Uwagi

Ostrzeżenie: BinaryFormatter jest niezabezpieczony i nie można go zabezpieczyć. Aby uzyskać więcej informacji, zobacz przewodnik po zabezpieczeniach BinaryFormatter i klasę System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.

Konstruktory

BinaryFormatter()
Przestarzałe.

Inicjuje nowe wystąpienie klasy BinaryFormatter z domyślnymi wartościami.

BinaryFormatter(ISurrogateSelector, StreamingContext)
Przestarzałe.

Inicjuje BinaryFormatter nowe wystąpienie klasy przy użyciu danego selektora zastępczego i kontekstu przesyłania strumieniowego.

Właściwości

AssemblyFormat
Przestarzałe.

Pobiera lub ustawia zachowanie deserializatora w odniesieniu do znajdowania i ładowania zestawów.

Binder
Przestarzałe.

(Niezabezpieczone) Pobiera lub ustawia obiekt typu SerializationBinder , który kontroluje powiązanie serializowanego obiektu na typ.

Context
Przestarzałe.

Pobiera lub ustawia StreamingContext dla tego formatnika.

FilterLevel
Przestarzałe.

Pobiera lub ustawia TypeFilterLevel automatyczne deserializacji BinaryFormatter wykonywane.

SurrogateSelector
Przestarzałe.

Pobiera lub ustawia ISurrogateSelector obiekt, który kontroluje podstawienie typów podczas serializacji i deserializacji.

TypeFormat
Przestarzałe.

Pobiera lub ustawia format, w którym opisy typów są określone w strumieniu serializowanym.

Metody

Deserialize(Stream)
Przestarzałe.

Deserializuje określony strumień do grafu obiektu.

Deserialize(Stream, HeaderHandler)
Przestarzałe.

Deserializuje określony strumień do grafu obiektu. Podana HeaderHandler funkcja obsługuje wszystkie nagłówki w tym strumieniu.

DeserializeMethodResponse(Stream, HeaderHandler, IMethodCallMessage)
Przestarzałe.

Deserializuje odpowiedź na zdalne wywołanie metody z podanego Streamelementu .

Equals(Object)
Przestarzałe.

Określa, czy dany obiekt jest taki sam, jak bieżący obiekt.

(Odziedziczone po Object)
GetHashCode()
Przestarzałe.

Służy jako domyślna funkcja skrótu.

(Odziedziczone po Object)
GetType()
Przestarzałe.

Type Pobiera wartość bieżącego wystąpienia.

(Odziedziczone po Object)
MemberwiseClone()
Przestarzałe.

Tworzy płytkią kopię bieżącego Objectelementu .

(Odziedziczone po Object)
Serialize(Stream, Object)
Przestarzałe.

Serializuje obiekt lub graf obiektów z określonym górnym (głównym) do danego strumienia.

Serialize(Stream, Object, Header[])
Przestarzałe.

Serializuje obiekt lub graf obiektów z określonym górnym (głównym) do danego strumienia dołączającego podane nagłówki.

ToString()
Przestarzałe.

Zwraca ciąg reprezentujący bieżący obiekt.

(Odziedziczone po Object)
UnsafeDeserialize(Stream, HeaderHandler)
Przestarzałe.

Deserializuje określony strumień do grafu obiektu. Podana HeaderHandler funkcja obsługuje wszystkie nagłówki w tym strumieniu.

UnsafeDeserializeMethodResponse(Stream, HeaderHandler, IMethodCallMessage)
Przestarzałe.

Deserializuje odpowiedź na zdalne wywołanie metody z podanego Streamelementu .

Dotyczy