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 的 URL,要在 DiscoveryClientReferenceCollection 中尋找。
傳回
如果 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