SearchResultCollection 類別

定義

SearchResultCollection 類別包含 SearchResult 查詢期間,Active Directory 階層所傳回的 DirectorySearcher 執行個體。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
實作

備註

由於執行限制, SearchResultCollection類別在進行垃圾收集時, 無法釋放其所有的非受控資源。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

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

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]

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

PropertiesLoaded

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

方法

Contains(SearchResult)

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

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)

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

(繼承來源 MarshalByRefObject)
Dispose()

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

Dispose(Boolean)

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

Equals(Object)

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

(繼承來源 Object)
Finalize()

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

GetEnumerator()

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

GetHashCode()

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

(繼承來源 Object)
GetLifetimeService()

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

(繼承來源 MarshalByRefObject)
GetType()

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

(繼承來源 Object)
IndexOf(SearchResult)

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

InitializeLifetimeService()

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

(繼承來源 MarshalByRefObject)
MemberwiseClone()

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

(繼承來源 Object)
MemberwiseClone(Boolean)

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

(繼承來源 MarshalByRefObject)
ToString()

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

(繼承來源 Object)

明確介面實作

ICollection.CopyTo(Array, Int32)

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

ICollection.IsSynchronized

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

ICollection.SyncRoot

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

擴充方法

Cast<TResult>(IEnumerable)

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

OfType<TResult>(IEnumerable)

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

AsParallel(IEnumerable)

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

AsQueryable(IEnumerable)

IEnumerable 轉換成 IQueryableConverts an IEnumerable to an IQueryable.

安全性

DirectoryServicesPermission
LinkDemand

適用於