ProfileSettings.Name Właściwość

Definicja

Pobiera lub ustawia nazwę ProfileSettings obiektu.

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

Wartość właściwości

String

Nazwa ProfileSettings obiektu. Wartość domyślna to pusty ciąg("").

Atrybuty

Przykłady

W poniższym przykładzie kodu pokazano, jak używać Name właściwości . Ten przykład kodu jest częścią większego przykładu udostępnionego HealthMonitoringSection dla klasy .

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

Uwagi

wymagana jest unikatowa nazwa. Zduplikowane nazwy mogą spowodować utratę danych podczas zapisywania sekcji konfiguracji.

Dotyczy

Zobacz też