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::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
- 繼承
-
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 的遠端方法呼叫。 |