Bagikan melalui


ProfileSettings.Name Properti

Definisi

Mendapatkan atau mengatur nama ProfileSettings objek.

public:
 property System::String ^ Name { System::String ^ get(); void set(System::String ^ value); };
[System.Configuration.ConfigurationProperty("name", DefaultValue="", IsKey=true, IsRequired=true)]
[System.Configuration.StringValidator(MinLength=1)]
public string Name { get; set; }
[<System.Configuration.ConfigurationProperty("name", DefaultValue="", IsKey=true, IsRequired=true)>]
[<System.Configuration.StringValidator(MinLength=1)>]
member this.Name : string with get, set
Public Property Name As String

Nilai Properti

Nama ProfileSettings objek. Defaultnya adalah string kosong("").

Atribut

Contoh

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

profileSetting.Name = "Custom";
profileSetting.Name = "Custom"

Keterangan

Nama unik diperlukan. Nama duplikat dapat mengakibatkan hilangnya data saat bagian konfigurasi disimpan.

Berlaku untuk

Lihat juga