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 物件的名稱。
傳回
如果集合包含具有指定 name
的 ProfileSettings 物件為,則為 true
,否則為 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"))