SearchResultCollection SearchResultCollection SearchResultCollection SearchResultCollection Class

定义

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
继承
SearchResultCollectionSearchResultCollectionSearchResultCollectionSearchResultCollection
实现

注解

由于实现限制, 在SearchResultCollection垃圾回收类时, 该类无法释放其所有非托管资源。Due to implementation restrictions, the SearchResultCollection class cannot release all of its unmanaged resources when it is garbage collected. 若要防止内存泄露, 必须在不再需要DisposeSearchResultCollection对象时调用方法。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)

创建一个对象,该对象包含生成用于与远程对象进行通信的代理所需的全部相关信息。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 对象占用的非托管资源,还可以选择释放托管资源。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()

检索控制此实例的生存期策略的当前生存期服务对象。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 的浅表副本。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 的元素复制到一个 Array 中。Copies 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.

扩展方法

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)

IEnumerable 转换为 IQueryableConverts an IEnumerable to an IQueryable.

安全性

DirectoryServicesPermission
LinkDemand

适用于