ProfilePropertySettings.SerializeAs 属性

定义

获取或设置动态生成的 ProfileCommon 类中关联的属性使用的序列化方法。Gets or sets the serialization method used for the associated property in the dynamically generated ProfileCommon class.

public:
 property System::Web::Configuration::SerializationMode SerializeAs { System::Web::Configuration::SerializationMode get(); void set(System::Web::Configuration::SerializationMode value); };
[System.Configuration.ConfigurationProperty("serializeAs", DefaultValue=Mono.Cecil.CustomAttributeArgument)]
public System.Web.Configuration.SerializationMode SerializeAs { get; set; }
member this.SerializeAs : System.Web.Configuration.SerializationMode with get, set
Public Property SerializeAs As SerializationMode

属性值

SerializationMode 值之一。One of the SerializationMode values. 默认值为 ProviderSpecificThe default is ProviderSpecific.

属性

示例

下面的代码示例说明如何使用 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

注解

有关配置文件属性的详细信息, 请参阅ASP.NET Profile Properties 概述For more information about profile properties, see ASP.NET Profile Properties Overview.

适用于

另请参阅