SearchResultCollection.Handle 屬性

定義

取得執行實際搜尋之 IDirectorySearch::ExecuteSearch 方法所傳回的控制代碼。Gets the handle that is returned by the IDirectorySearch::ExecuteSearch method that performs the actual search. 如需詳細資訊,請參閱 IDirectorySearch::ExecuteSearch 一文。For more information, see the IDirectorySearch::ExecuteSearch article.

public:
 property IntPtr Handle { IntPtr get(); };
public IntPtr Handle { get; }
member this.Handle : nativeint
Public ReadOnly Property Handle As IntPtr

屬性值

這個集合所使用的 ADS_SEARCH_HANDLE 值。The ADS_SEARCH_HANDLE value that this collection uses.

備註

建立這個集合的會IDirectorySearch::ExecuteSearch呼叫方法, 讓SearchResultCollection物件可以使用查詢結果。 DirectorySearcherThe DirectorySearcher that created this collection calls the IDirectorySearch::ExecuteSearch method, which makes the query results available to the SearchResultCollection object. 如需詳細資訊,請參閱 IDirectorySearch::ExecuteSearch 一文。For more information, see the IDirectorySearch::ExecuteSearch article.

每次執行查詢時, 該查詢結果的控制碼會與其SearchResultCollection物件相關聯。Each time that a query is performed, a handle for the results of that query is associated with its SearchResultCollection object. 這個控制碼對應于 ADSI 中的搜尋控制碼。This handle corresponds to the search handle in ADSI. 這個控制碼會持續存在, Dispose()直到您在SearchResultCollection物件上呼叫方法為止, Dispose()因此您必須呼叫以防止記憶體流失。This handle persists until you call the Dispose() method on the SearchResultCollection object, so you must call Dispose() to prevent a memory leak. 垃圾收集行程不會釋放此特定物件的記憶體。The garbage collector does not free memory for this particular object.

適用於