ProfilePropertySettings.SerializeAs 属性

定义

获取或设置动态生成的 ProfileCommon 类中关联的属性使用的序列化方法。

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

属性值

SerializationMode 值之一。 默认值为 ProviderSpecific

属性

示例

下面的代码示例说明如何使用 SerializeAs 属性。 此代码示例是为 ProfileSection 类提供的一个更大示例的一部分。

// 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 配置文件属性概述

适用于

另请参阅