Bagikan melalui


ProfilePropertySettings.Type Properti

Definisi

Mendapatkan atau mengatur nama jenis properti terkait di kelas yang dihasilkan ProfileCommon secara dinamis.

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

Nilai Properti

Referensi jenis yang valid dan sepenuhnya memenuhi syarat, atau string kosong (""). Defaultnya adalah string kosong.

Atribut

Contoh

Contoh kode berikut menunjukkan cara menggunakan Type properti . Contoh kode ini adalah bagian dari contoh yang lebih besar yang disediakan untuk ProfileSection kelas .

// 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"

Keterangan

Ketika diatur ke referensi jenis yang valid, jenis ini digunakan untuk properti bernama di kelas yang dihasilkan ProfileCommon .

Referensi jenis dibentuk sebagai berikut (item dalam tanda kurung tidak diperlukan): Namespace.Typename, Assemblyname[,] [Version=x,] [Culture=y,] [PublicKeyToken=z]

Contohnya:

"ExampleNameSpace.ExampleType, Example.Assembly, Version=%ASSEMBLY_VERSION%, Culture=neutral, PublicKeyToken=%MICROSOFT_PUBLICKEY%"

Berlaku untuk

Lihat juga