ProfileSettingsCollection.Add(ProfileSettings) Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Ajoute un ProfileSettings objet à la collection.
public:
void Add(System::Web::Configuration::ProfileSettings ^ profilesSettings);
public void Add(System.Web.Configuration.ProfileSettings profilesSettings);
member this.Add : System.Web.Configuration.ProfileSettings -> unit
Public Sub Add (profilesSettings As ProfileSettings)
Paramètres
- profilesSettings
- ProfileSettings
Objet ProfileSettings à ajouter à la collection.
Exceptions
L’objet ProfileSettings à ajouter existe déjà dans la collection, ou la collection est en lecture seule.
Exemples
L’exemple de code suivant montre comment utiliser la Add méthode. Cet exemple de code fait partie d’un exemple plus grand fourni pour la HealthMonitoringSection classe.
// Get the current Enabled property value.
Boolean enabledValue = healthMonitoringSection.Enabled;
// Set the Enabled property to false.
healthMonitoringSection.Enabled = false;
' Get the current Enabled property value.
Dim enabledValue As Boolean = healthMonitoringSection.Enabled
' Set the Enabled property to False.
healthMonitoringSection.Enabled = False
Remarques
La collection ne doit pas déjà contenir d’objet ProfileSettings portant le même nom.