SearchResultCollection Class
The SearchResultCollection class contains the SearchResult instances that the Active Directory hierarchy returned during a DirectorySearcher query.
Namespace: System.DirectoryServices
Assembly: System.DirectoryServices (in System.DirectoryServices.dll)
The SearchResultCollection type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | Count | Gets the number of SearchResult objects in this collection. |
![]() | Handle | Gets the handle that is returned by the IDirectorySearch::ExecuteSearch method that performs the actual search. For more information, see the IDirectorySearch::ExecuteSearch topic in the MSDN Library at http://msdn.microsoft.com/library. |
![]() | Item | Gets the SearchResult object that is located at a specified index in this collection. |
![]() | PropertiesLoaded | Gets the DirectorySearcher properties that were specified before the search was executed. |
| Name | Description | |
|---|---|---|
![]() | Contains | Determines if a specified SearchResult object is in this collection. |
![]() | CopyTo | Copies all SearchResult objects in this collection to the specific array, starting at the specified index in the target array. |
![]() | CreateObjRef | 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() | Releases all resources that are used by the SearchResultCollection object. |
![]() | Dispose(Boolean) | 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. (Inherited from Object.) |
![]() | Finalize | Overrides the Object.Finalize method. (Overrides Object.Finalize().) |
![]() | GetEnumerator | Returns an enumerator that you can use to iterate through this collection. |
![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() | GetLifetimeService | Retrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from MarshalByRefObject.) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | IndexOf | 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. (Inherited from MarshalByRefObject.) |
![]() | MemberwiseClone() | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() | MemberwiseClone(Boolean) | Creates a shallow copy of the current MarshalByRefObject object. (Inherited from MarshalByRefObject.) |
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
| Name | Description | |
|---|---|---|
![]() | AsParallel | Enables parallelization of a query. (Defined by ParallelEnumerable.) |
![]() | AsQueryable | Converts an IEnumerable to an IQueryable. (Defined by Queryable.) |
![]() | Cast<TResult> | Casts the elements of an IEnumerable to the specified type. (Defined by Enumerable.) |
![]() | OfType<TResult> | Filters the elements of an IEnumerable based on a specified type. (Defined by Enumerable.) |
| Name | Description | |
|---|---|---|
![]() ![]() | ICollection.CopyTo | Copies the elements of the ICollection to an Array, starting at a particular Array index. |
![]() ![]() | ICollection.IsSynchronized | Gets a value indicating whether access to the ICollection is synchronized (thread safe). |
![]() ![]() | ICollection.SyncRoot | Gets an object that can be used to synchronize access to the ICollection. |
Due to implementation restrictions, the SearchResultCollection class cannot release all of its unmanaged resources when it is garbage collected. To prevent a memory leak, you must call the Dispose method when the SearchResultCollection object is no longer needed.
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.






