语言

ProfileSettingsCollection.Contains(String) 方法

定义

指示集合是否包含 ProfileSettings 具有指定名称的对象。

public:
 bool Contains(System::String ^ name);
public bool Contains(string name);
member this.Contains : string -> bool
Public Function Contains (name As String) As Boolean

参数

name
String

集合中对象的名称 ProfileSettings 。

返回

如果集合包含具有指定对象,则为 />;否则为 。

示例

下面的代码示例演示如何使用 Contains 该方法。 该代码示例是 HealthMonitoringSection 类中的一个较大示例的一部分。

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

适用于

另请参阅