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 。
返回
示例
下面的代码示例演示如何使用 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"))