SerializationMode 枚举

定义

确定用于 ProfilePropertySettings 对象的序列化方法。Determines the serialization method used for a ProfilePropertySettings object.

public enum class SerializationMode
public enum SerializationMode
type SerializationMode = 
Public Enum SerializationMode
继承
SerializationMode

字段

Binary 2

ProfilePropertySettings 对象使用二进制序列化进行序列化。The ProfilePropertySettings object is serialized using binary serialization.

ProviderSpecific 3

提供程序具有类型的隐式信息,并负责决定如何将 ProfilePropertySettings 对象序列化到数据存储区中。The provider has implicit knowledge of the type and is responsible for deciding how to serialize the ProfilePropertySettings object into the data store.

String 0

ProfilePropertySettings 对象序列化为简单字符串。The ProfilePropertySettings object is serialized to a simple string.

Xml 1

配置文件 ProfilePropertySettings 使用 XML 序列化模式序列化为 XML。The profile ProfilePropertySettings is serialized as XML using XML serialization.

示例

下面的代码示例说明如何使用 SerializeAs 属性。The following code example shows how to use the SerializeAs property. 此代码示例是为ProfileSection类提供的更大示例的一部分。This code example is part of a larger example provided for the ProfileSection class.

// Get the current SerializeAs property value.
Console.WriteLine(
    "Current SerializeAs value: '{0}'", profilePropertySettings.SerializeAs);

// Set the SerializeAs property to SerializationMode.Binary.
profilePropertySettings.SerializeAs = SerializationMode.Binary;
' Get the current SerializeAs property value.
Console.WriteLine( _
    "Current SerializeAs value: '{0}'", profilePropertySettings.SerializeAs)

' Set the SerializeAs property to SerializationMode.Binary.
profilePropertySettings.SerializeAs = SerializationMode.Binary

注解

ProfilePropertySettings对象SerializeAs的属性控制单个配置文件属性设置的序列化模式。The SerializeAs property of the ProfilePropertySettings object controls the serialization mode for a single profile property setting.

适用于

另请参阅