SerializationInfo 類別
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
儲存序列化或還原序列化物件所需的所有資料。 此類別無法獲得繼承。
public ref class SerializationInfo sealed
C#
public sealed class SerializationInfo
C#
[System.Runtime.InteropServices.ComVisible(true)]
public sealed class SerializationInfo
type SerializationInfo = class
[<System.Runtime.InteropServices.ComVisible(true)>]
type SerializationInfo = class
Public NotInheritable Class SerializationInfo
- 繼承
-
SerializationInfo
- 屬性
這個類別是由具有自訂序列化行為的 物件使用。 或 ISerializationSurrogate 上的 ISerializable 方法會 GetObjectData 以想要序列化之每個資訊片段的名稱、類型和值填入 SerializationInfo 存放區。 還原序列化期間,適當的函式可以擷取此資訊。
物件會在序列化期間使用 AddValue 方法新增至 SerializationInfo 存放區,並使用 方法在還原序列化 GetValue 時從 SerializationInfo 存放區擷取。
如需自訂序列化的詳細資訊,請參閱 自訂序列化。
Serialization |
已淘汰.
建立 SerializationInfo 類別的新執行個體。 |
Serialization |
已淘汰.
初始化 SerializationInfo 類別的新執行個體。 |
Assembly |
取得或設定僅在序列化期間序列化之型別的組件名稱。 |
Full |
取得或設定要序列化之 Type 的完整名稱。 |
Is |
取得組件名稱是否已明確設定。 |
Is |
取得完整型別名稱是否已明確設定。 |
Member |
取得已經加入至 SerializationInfo 存放區的成員數目。 |
Object |
傳回要序列化之物件的型別。 |
產品 | 版本 |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |