SearchResultCollection.IndexOf(SearchResult) 方法

定義

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

public:
 int IndexOf(System::DirectoryServices::SearchResult ^ result);
public int IndexOf (System.DirectoryServices.SearchResult result);
member this.IndexOf : System.DirectoryServices.SearchResult -> int
Public Function IndexOf (result As SearchResult) As Integer

參數

result
SearchResult

要在此集合中搜尋的 SearchResult 物件。The SearchResult object to search for in this collection.

傳回

第一個相符物件的以零起始的索引。The zero-based index of the first matching object. 如果這個集合中沒有成員與 SearchResult 物件相同,則傳回 -1。Returns -1 if no member of this collection is identical to the SearchResult object.

適用於