Partage via


ProfileGroupSettings.Name Propriété

Définition

Obtient ou définit le nom du groupe d'objets ProfilePropertySettings que cet objet contient.

public:
 property System::String ^ Name { System::String ^ get(); };
[System.Configuration.ConfigurationProperty("name", IsKey=true, IsRequired=true)]
public string Name { get; }
[<System.Configuration.ConfigurationProperty("name", IsKey=true, IsRequired=true)>]
member this.Name : string
Public ReadOnly Property Name As String

Valeur de propriété

String

Chaîne comportant le nom du groupe d'objets ProfilePropertySettings que cet objet contient. La valeur par défaut est une chaîne vide ("").

Attributs

Exemples

L'exemple de code suivant montre comment utiliser la propriété Name. Cet exemple de code fait partie d’un exemple plus grand fourni pour la ProfileSection classe.

// Display all current ProfileGroupSettings.
Console.WriteLine("Current ProfileGroupSettings:");
int PGSCtr = 0;
foreach (ProfileGroupSettings propGroups in profileSection.PropertySettings.GroupSettings)
{
    Console.WriteLine("  {0}: ProfileGroupSetting '{1}'", ++PGSCtr,
        propGroups.Name);
    int PPSCtr = 0;
    foreach (ProfilePropertySettings props in propGroups.PropertySettings)
    {
        Console.WriteLine("    {0}: ProfilePropertySetting '{1}'", ++PPSCtr,
            props.Name);
    }
}
' Display all current ProfileGroupSettings.
Console.WriteLine("Current ProfileGroupSettings:")
Dim PGSCtr As Integer = 0
For Each propGroups As ProfileGroupSettings In profileSection.PropertySettings.GroupSettings
                    Console.WriteLine("  {0}: ProfileGroupSettings '{1}'", ++PGSCtr, _
        propGroups.Name)
    Dim PPSCtr As Integer = 0
    For Each props As ProfilePropertySettings In propGroups.PropertySettings
        Console.WriteLine("    {0}: ProfilePropertySetting '{1}'", ++PPSCtr, _
            props.Name)
    Next
Next

Remarques

Le nom du groupe doit être unique dans une ProfileGroupSettingsCollection collection ; sinon, une exception est levée lorsque le fichier de configuration est enregistré.

S’applique à

Voir aussi