ProfileSettingsCollection.Contains(String) Metod
Definition
Viktigt
En del information gäller för förhandsversionen av en produkt och kan komma att ändras avsevärt innan produkten blir allmänt tillgänglig. Microsoft lämnar inga garantier, uttryckliga eller underförstådda, avseende informationen som visas här.
Anger om samlingen innehåller ett ProfileSettings objekt med det angivna namnet.
public:
bool Contains(System::String ^ name);
public bool Contains(string name);
member this.Contains : string -> bool
Public Function Contains (name As String) As Boolean
Parametrar
- name
- String
Namnet på ett ProfileSettings objekt i samlingen.
Returer
trueom samlingen innehåller ett ProfileSettings objekt med angivet name, annars . false
Exempel
I följande kodexempel visas hur metoden Contains används. Det här kodexemplet är en del av ett större exempel för HealthMonitoringSection klassen.
// See if the ProfileSettings collection property contains the event 'Default'.
Console.WriteLine("Profiles contains 'Default': {0}.",
healthMonitoringSection.Profiles.Contains("Default"));
' See if the ProfileSettings collection property contains the event 'Default'.
Console.WriteLine("Profiles contains 'Default': {0}.", _
healthMonitoringSection.Profiles.Contains("Default"))