SearchResultCollection SearchResultCollection SearchResultCollection SearchResultCollection Class


SearchResultCollection 類別包含 DirectorySearcher 查詢期間,Active Directory 階層所傳回的 SearchResult 執行個體。The SearchResultCollection class contains the SearchResult instances that the Active Directory hierarchy returned during a DirectorySearcher query.

public ref class SearchResultCollection : MarshalByRefObject, IDisposable, System::Collections::ICollection
public class SearchResultCollection : MarshalByRefObject, IDisposable, System.Collections.ICollection
type SearchResultCollection = class
    inherit MarshalByRefObject
    interface ICollection
    interface IEnumerable
    interface IDisposable
Public Class SearchResultCollection
Inherits MarshalByRefObject
Implements ICollection, IDisposable


由於實作限制SearchResultCollection回收時,類別無法釋放它的所有 unmanaged 資源。Due to implementation restrictions, the SearchResultCollection class cannot release all of its unmanaged resources when it is garbage collected. 若要避免記憶體流失,您必須呼叫Dispose方法時SearchResultCollection不再需要物件。To prevent a memory leak, you must call the Dispose method when the SearchResultCollection object is no longer needed.


Count Count Count Count

取得這個集合中的 SearchResult 物件數目。Gets the number of SearchResult objects in this collection.

Handle Handle Handle 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.

Item[Int32] Item[Int32] Item[Int32] Item[Int32]

取得位在這個集合中之指定索引處的 SearchResult 物件。Gets the SearchResult object that is located at a specified index in this collection.

PropertiesLoaded PropertiesLoaded PropertiesLoaded PropertiesLoaded

取得在執行搜尋之前所指定的 DirectorySearcher 屬性。Gets the DirectorySearcher properties that were specified before the search was executed.


Contains(SearchResult) Contains(SearchResult) Contains(SearchResult) Contains(SearchResult)

決定指定的 SearchResult 物件是否在這個集合中。Determines if a specified SearchResult object is in this collection.

CopyTo(SearchResult[], Int32) CopyTo(SearchResult[], Int32) CopyTo(SearchResult[], Int32) CopyTo(SearchResult[], Int32)

從目標陣列中的指定索引開始,將這個集合中的所有 SearchResult 物件複製到特定陣列。Copies all SearchResult objects in this collection to the specific array, starting at the specified index in the target array.

CreateObjRef(Type) CreateObjRef(Type) CreateObjRef(Type) CreateObjRef(Type)

建立包含所有相關資訊的物件,這些資訊是產生用來與遠端物件通訊的所需 Proxy。Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.

(Inherited from MarshalByRefObject)
Dispose() Dispose() Dispose() Dispose()

釋放 SearchResultCollection 物件所使用的全部資源。Releases all resources that are used by the SearchResultCollection object.

Dispose(Boolean) Dispose(Boolean) Dispose(Boolean) Dispose(Boolean)

釋放 SearchResultCollection 物件所使用的 Unmanaged 資源,並選擇性釋放 Managed 資源。Releases the unmanaged resources that are used by the SearchResultCollection object and optionally releases the managed resources.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(Inherited from Object)
Finalize() Finalize() Finalize() Finalize()

覆寫 Finalize() 方法。Overrides the Finalize() method.

GetEnumerator() GetEnumerator() GetEnumerator() GetEnumerator()

傳回您可以用來逐一查看這個集合的列舉值。Returns an enumerator that you can use to iterate through this collection.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(Inherited from Object)
GetLifetimeService() GetLifetimeService() GetLifetimeService() GetLifetimeService()

擷取控制這個執行個體存留期 (Lifetime) 原則的目前存留期服務物件。Retrieves the current lifetime service object that controls the lifetime policy for this instance.

(Inherited from MarshalByRefObject)
GetType() GetType() GetType() GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(Inherited from Object)
IndexOf(SearchResult) IndexOf(SearchResult) IndexOf(SearchResult) IndexOf(SearchResult)

傳回這個集合中指定之 SearchResult 物件第一次出現的索引。Returns the index of the first occurrence of the specified SearchResult object in this collection.

InitializeLifetimeService() InitializeLifetimeService() InitializeLifetimeService() InitializeLifetimeService()

取得存留期服務物件,以控制這個執行個體的存留期原則。Obtains a lifetime service object to control the lifetime policy for this instance.

(Inherited from MarshalByRefObject)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(Inherited from Object)
MemberwiseClone(Boolean) MemberwiseClone(Boolean) MemberwiseClone(Boolean) MemberwiseClone(Boolean)

建立目前 MarshalByRefObject 物件的淺層複本。Creates a shallow copy of the current MarshalByRefObject object.

(Inherited from MarshalByRefObject)
ToString() ToString() ToString() ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(Inherited from Object)


ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32)

從特定的 ICollection 索引開始,將 Array 的項目複製至 ArrayCopies the elements of the ICollection to an Array, starting at a particular Array index.

ICollection.IsSynchronized ICollection.IsSynchronized ICollection.IsSynchronized ICollection.IsSynchronized

取得值,這個值表示對 ICollection 的存取是否同步 (安全執行緒)。Gets a value indicating whether access to the ICollection is synchronized (thread safe).

ICollection.SyncRoot ICollection.SyncRoot ICollection.SyncRoot ICollection.SyncRoot

取得可用以同步存取 ICollection 的物件。Gets an object that can be used to synchronize access to the ICollection.

Extension Methods

Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable)

IEnumerable 的項目轉換成指定的型別。Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable)

根據指定的型別來篩選 IEnumerable 的項目。Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable)

啟用查詢的平行化作業。Enables parallelization of a query.

AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable)

將轉換IEnumerableIQueryableConverts an IEnumerable to an IQueryable.