This documentation is archived and is not being maintained.
DiscoveryExceptionDictionary.Contains Method
.NET Framework 1.1
Determines whether the DiscoveryExceptionDictionary contains an Exception with the specified URL.
[Visual Basic] Public Function Contains( _ ByVal url As String _ ) As Boolean [C#] public bool Contains( string url ); [C++] public: bool Contains( String* url ); [JScript] public function Contains( url : String ) : Boolean;
Parameters
- url
- The URL of the Exception to locate within the DiscoveryExceptionDictionary.
Return Value
true if the DiscoveryExceptionDictionary contains an Exception with the specified URL; otherwise, false.
Exceptions
| Exception Type | Condition |
|---|---|
| ArgumentNullException | url is a null reference (Nothing in Visual Basic). |
Example
[Visual Basic] Dim myExceptionDictionary As DiscoveryExceptionDictionary = myDiscoveryClientProtocol2.Errors If myExceptionDictionary.Contains(myUrlKey) = True Then Console.WriteLine("'myExceptionDictionary' contains " + _ "a discovery exception for the key '" + myUrlKey + "'") Else Console.WriteLine("'myExceptionDictionary' does not contain" + _ " a discovery exception for the key '" + myUrlKey + "'") End If [C#] DiscoveryExceptionDictionary myExceptionDictionary = myDiscoveryClientProtocol2.Errors; if ( myExceptionDictionary.Contains(myUrlKey) == true ) { Console.WriteLine("'myExceptionDictionary' contains " + " a discovery exception for the key '" + myUrlKey + "'"); } else { Console.WriteLine("'myExceptionDictionary' does not contain" + " a discovery exception for the key '" + myUrlKey + "'"); } [C++] DiscoveryExceptionDictionary* myExceptionDictionary = myDiscoveryClientProtocol2->Errors; if ( myExceptionDictionary->Contains(myUrlKey) == true ) { Console::WriteLine(S"'myExceptionDictionary' contains a discovery exception for the key '{0}'", myUrlKey ); } else { Console::WriteLine(S"'myExceptionDictionary' does not contain a discovery exception for the key '{0}'", myUrlKey ); }
[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button
in the upper-left corner of the page.
Requirements
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family
See Also
DiscoveryExceptionDictionary Class | DiscoveryExceptionDictionary Members | System.Web.Services.Discovery Namespace | Contains
Show: