DiscoveryClientDocumentCollection.Contains(String) Methode

Definitie

Bepaalt of het DiscoveryClientDocumentCollection een object met de opgegeven URL bevat.

public:
 bool Contains(System::String ^ url);
public bool Contains(string url);
member this.Contains : string -> bool
Public Function Contains (url As String) As Boolean

Parameters

url
String

De URL voor het document die moet worden gevonden in de DiscoveryClientDocumentCollection.

Retouren

trueals het DiscoveryClientDocumentCollection een object met de opgegeven URL bevat; anders. false

Uitzonderingen

url is null.

Voorbeelden

In het volgende codevoorbeeld wordt de Contains methode aangeroepen om te bepalen of het detectiedocument een lid bevat met de URL die is opgeslagen in de StringUrl variabele.

bool myContains = myDiscoveryClientDocumentCollection->Contains( myStringUrl );
if ( myContains )
   Console::WriteLine( "The discovery document {0} is present in the  Collection", myStringUrl );
bool myContains = myDiscoveryClientDocumentCollection.Contains(myStringUrl);
if (myContains)
   Console.WriteLine("The discovery document {0} is present in the"
                     + " Collection",myStringUrl);
Dim myContains As Boolean = myDiscoveryClientDocumentCollection.Contains(myStringUrl)
If myContains Then
   Console.WriteLine("The discovery document {0} is present in the Collection", _
                                                                        myStringUrl)
End If

Van toepassing op

Zie ook