DiscoveryExceptionDictionary.Contains(String) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
判斷 DiscoveryExceptionDictionary 是否包含有指定 URL 的 Exception。
public:
bool Contains(System::String ^ url);
public bool Contains (string url);
member this.Contains : string -> bool
Public Function Contains (url As String) As Boolean
參數
- url
- String
Exception 的 URL,要在 DiscoveryExceptionDictionary 中尋找。
傳回
如果 DiscoveryExceptionDictionary 包含有指定 URL 的 Exception,則為 true
,否則為 false
。
例外狀況
url
為 null
。
範例
DiscoveryExceptionDictionary^ myExceptionDictionary = myDiscoveryClientProtocol2->Errors;
if ( myExceptionDictionary->Contains( myUrlKey ) == true )
{
Console::WriteLine( "'myExceptionDictionary' contains a discovery exception for the key '{0}'", myUrlKey );
}
else
{
Console::WriteLine( "'myExceptionDictionary' does not contain a discovery exception for the key '{0}'", myUrlKey );
}
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 + "'");
}
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