Share via


其他搜尋選項

DirectorySearcher 包含其他搜尋選項,可加入應用程式來擷取最有可能的結果集。

若搜尋未在預設伺服器上得到結果,則此伺服器可傳回讓用戶端的另一個伺服器搜尋的轉介。若轉介追尋設定為 [全部],則用戶端將查詢轉介中指定的伺服器。若設定為 [無],則用戶端不會追尋轉介。若要設定轉介追尋,請使用 ReferralChasing 屬性。您可在 ReferralChasingOption 列舉中找到可用於 ReferralChasing 的旗標。下列程式碼範例示範如何設定此屬性。

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.

請參閱

參考

System.DirectoryServices
DirectorySearcher
ReferralChasingOption

概念

搜尋目錄

Send comments about this topic to Microsoft.

Copyright © 2007 by Microsoft Corporation.All rights reserved.