ProfilePropertySettings.Type 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定動態產生 ProfileCommon 類別中相關屬性的類型名稱。
public:
property System::String ^ Type { System::String ^ get(); void set(System::String ^ value); };
[System.Configuration.ConfigurationProperty("type", DefaultValue="string")]
public string Type { get; set; }
[<System.Configuration.ConfigurationProperty("type", DefaultValue="string")>]
member this.Type : string with get, set
Public Property Type As String
屬性值
一個有效且完全限定的型別參考,或是空字串(“”)。 預設值是空字串。
- 屬性
範例
以下程式碼範例說明如何使用該 Type 屬性。 此程式碼範例是本類別更大範例 ProfileSection 的一部分。
// Get the current Type property value.
Console.WriteLine(
"Current Type value: '{0}'", profilePropertySettings.Type);
// Set the Type property to "System.DateTime".
profilePropertySettings.Type = "System.DateTime";
' Get the current Type property value.
Console.WriteLine( _
"Current Type value: '{0}'", profilePropertySettings.Type)
' Set the Type property to "System.DateTime".
profilePropertySettings.Type = "System.DateTime"
備註
當設定為有效型別參考時,該型別用於產生 ProfileCommon 類別中的命名屬性。
類型參考如下(括號內的項目不需標示): Namespace.Typename, Assemblyname[,] [Version=x,] [Culture=y,] [PublicKeyToken=z]
例如:
"ExampleNameSpace.ExampleType, Example.Assembly, Version=%ASSEMBLY_VERSION%, Culture=neutral, PublicKeyToken=%MICROSOFT_PUBLICKEY%"