ProfileSettingsCollection.Contains(String) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
表示集合是否包含 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 的名稱。
傳回
true若集合包含ProfileSettings具有指定 name;的物件;否則,。 false
範例
下列程式代碼範例示範如何使用 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"))