Ulteriori opzioni di ricerca

DirectorySearcher contiene ulteriori opzioni di ricerca che è possibile aggiungere a un'applicazione per recuperare l'insieme di risultati migliore.

Se la ricerca non produce risultati sul server predefinito, il server può restituire un riferimento a un altro server in cui il client può eseguire ricerche. Se l'opzione del riferimento è impostata su Tutti, il client interrogherà il server citato nel riferimento. Se è impostata su Nessuno, il client non interrogherà i riferimenti. Per impostare l'interrogazione dei riferimenti, utilizzare la proprietà ReferralChasing. I flag utilizzabili per ReferralChasing sono reperibili nell'enumerazione ReferralChasingOption. Nell'esempio di codice riportato di seguito viene illustrato come impostare questa proprietà.

Dim entry As New DirectoryEntry("LDAP://CN=computers,DC=buffalo,DC=corp,DC=fabrikam,DC=com")
Dim mySearcher As New DirectorySearcher(entry)
mySearcher.ReferralChasing = ReferralChasingOption.All
' Handle results.
' Handle errors.
DirectoryEntry entry = new DirectoryEntry("LDAP://CN=computers,DC=buffalo,DC=corp,DC=fabrikam,DC=com");
DirectorySearcher mySearcher = new DirectorySearcher(entry);
mySearcher.ReferralChasing = ReferralChasingOption.All;
// Handle results.
// Handle errors.

Vedere anche

Riferimenti

System.DirectoryServices
DirectorySearcher
ReferralChasingOption

Concetti

Ricerca nella directory

Send comments about this topic to Microsoft.

Copyright © 2007 Microsoft Corporation. Tutti i diritti riservati.