BinaryFormatter 类 
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
注意
BinaryFormatter serialization is obsolete and should not be used. See https://aka.ms/binaryformatter for more information.
以二进制格式序列化和反序列化对象或连接对象的整个图形。
public ref class BinaryFormatter sealed : System::Runtime::Serialization::IFormatterpublic ref class BinaryFormatter sealed : System::Runtime::Remoting::Messaging::IRemotingFormatterpublic 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.IFormatterpublic sealed class BinaryFormatter : System.Runtime.Remoting.Messaging.IRemotingFormatter[System.Runtime.InteropServices.ComVisible(true)]
public sealed class BinaryFormatter : System.Runtime.Remoting.Messaging.IRemotingFormattertype 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 IFormattertype BinaryFormatter = class
    interface IRemotingFormatter
    interface IFormatter[<System.Runtime.InteropServices.ComVisible(true)>]
type BinaryFormatter = class
    interface IRemotingFormatter
    interface IFormatterPublic NotInheritable Class BinaryFormatter
Implements IFormatterPublic NotInheritable Class BinaryFormatter
Implements IRemotingFormatter- 继承
- 
				BinaryFormatter
- 属性
- 实现
注解
警告:BinaryFormatter 不安全,无法确保安全。 有关详细信息,请参阅 BinaryFormatter 安全指南 和 System.Runtime.Serialization.Formatters.Binary.BinaryFormatter 类。
构造函数
| BinaryFormatter() | 
				已过时.
			 使用默认值初始化 BinaryFormatter 类的新实例。 | 
| BinaryFormatter(ISurrogateSelector, StreamingContext) | 
				已过时.
			 使用给定的代理项选择器和流上下文来初始化 BinaryFormatter 类的新实例。 | 
属性
| AssemblyFormat | 
				已过时.
			 获取或设置与查找加集有关的反序列化器行为。 | 
| Binder | 
				已过时.
			 (不安全)获取或设置控制将序列化对象绑定到类型的 SerializationBinder 类型的对象。 | 
| Context | 
				已过时.
			 获取或设置此格式化程序的 StreamingContext。 | 
| FilterLevel | 
				已过时.
			 获取或设置 TypeFilterLevel 所执行的自动反序列化的 BinaryFormatter。 | 
| SurrogateSelector | 
				已过时.
			 获取或设置控制序列化和反序列化过程的类型替换的 ISurrogateSelector. | 
| TypeFormat | 
				已过时.
			 获取或设置类型说明在序列化流中的布局格式。 | 
方法
| Deserialize(Stream) | 
				已过时.
			 将指定的流反序列化为对象图形。 | 
| Deserialize(Stream, HeaderHandler) | 
				已过时.
			 将指定的流反序列化为对象图形。 所提供的 HeaderHandler 处理该流中的任何标题。 | 
| DeserializeMethodResponse(Stream, HeaderHandler, IMethodCallMessage) | 
				已过时.
			 将对远程方法调用的响应从所提供的 Stream 进行反序列化。 | 
| Equals(Object) | 
		已过时.
	 确定指定对象是否等于当前对象。(继承自 Object) | 
| GetHashCode() | 
		已过时.
	 作为默认哈希函数。(继承自 Object) | 
| GetType() | 
		已过时.
	 获取当前实例的 Type。(继承自 Object) | 
| MemberwiseClone() | 
		已过时.
	 创建当前 Object 的浅表副本。(继承自 Object) | 
| Serialize(Stream, Object) | 
				已过时.
			 将对象或具有指定顶级(根)的对象图形序列化为给定流。 | 
| Serialize(Stream, Object, Header[]) | 
				已过时.
			 将对象或具有指定顶级(根)的对象图形序列化为附加所提供标题的给定流。 | 
| ToString() | 
		已过时.
	 返回表示当前对象的字符串。(继承自 Object) | 
| UnsafeDeserialize(Stream, HeaderHandler) | 
				已过时.
			 将指定的流反序列化为对象图形。 所提供的 HeaderHandler 处理该流中的任何标题。 | 
| UnsafeDeserializeMethodResponse(Stream, HeaderHandler, IMethodCallMessage) | 
				已过时.
			 将对远程方法调用的响应从所提供的 Stream 进行反序列化。 |