RuleSettingsCollection.Contains Method (String)

 

Returns true if the collection contains a RuleSettings object with the specified name.

Namespace:   System.Web.Configuration
Assembly:  System.Web (in System.Web.dll)

Public Function Contains (
	name As String
) As Boolean

Parameters

name
Type: System.String

The name of a RuleSettings object in the collection.

Return Value

Type: System.Boolean

true if the collection contains a RuleSettings object with the specified name; otherwise, false.

Returns false if the specified name does not exist.

The following code example shows how to use the Contains method. This code example is part of a larger example provided for the HealthMonitoringSection class.

' See if the Rules collection property contains the RuleSettings 'All Errors Default'.
Console.WriteLine("EventMappings contains 'All Errors Default': {0}.", _
    healthMonitoringSection.Rules.Contains("All Errors Default"))

.NET Framework
Available since 2.0
Return to top
Show: