FindOne Method
Collapse the table of content
Expand the table of content

DirectorySearcher.FindOne Method ()


Executes the search and returns only the first entry that is found.

Namespace:   System.DirectoryServices
Assembly:  System.DirectoryServices (in System.DirectoryServices.dll)

public SearchResult FindOne()

Return Value

Type: System.DirectoryServices.SearchResult

A SearchResult object that contains the first entry that is found during the search.

If more than one entry is found during the search, only the first entry is returned. If no entries are found to match the search criteria, a null reference (Nothing in Visual Basic) is returned.

.NET Framework
Available since 1.1
Return to top
© 2015 Microsoft