ProfileSettingsCollection.Contains(String) Metod

Definition

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"))

Gäller för

Se även