共用方式為


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

適用於

另請參閱