DiscoveryClientReferenceCollection.Contains(String) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
确定 DiscoveryClientReferenceCollection 是否包含具有指定的 URL 的 DiscoveryReference。
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
要在 DiscoveryReference 中查找的 DiscoveryClientReferenceCollection 的 URL。
返回
如果 DiscoveryClientReferenceCollection 包含具有指定的 URL 的 DiscoveryReference,则为 true
;否则为 false
。
示例
String^ myStringUrl1 = "http://localhost/dataservice.disco";
if ( myDiscoveryClientReferenceCollection->Contains( myStringUrl1 ) )
{
Console::WriteLine( "The document reference {0} is part of the collection.", myStringUrl1 );
}
string myStringUrl1 = "http://localhost/dataservice.disco";
if (myDiscoveryClientReferenceCollection.Contains(myStringUrl1))
{
Console.WriteLine("The document reference {0} is part of the"
+ " collection.", myStringUrl1);
}
Dim myStringUrl1 As String = "http://localhost/dataservice.disco"
If myDiscoveryClientReferenceCollection.Contains(myStringUrl1) Then
Console.WriteLine("The document reference {0} is part of the" + _
" collection.", myStringUrl1)
End If