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 中查找的 DiscoveryExceptionDictionary 的 URL。
返回
如果 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