DirectoryServerCollection.IndexOf(DirectoryServer) 方法

定义

返回指定的 DirectoryServer 对象在此数组中的第一个匹配项的索引。Returns the index of the first occurrence of the specified DirectoryServer object in this array.

public:
 int IndexOf(System::DirectoryServices::ActiveDirectory::DirectoryServer ^ server);
public int IndexOf (System.DirectoryServices.ActiveDirectory.DirectoryServer server);
member this.IndexOf : System.DirectoryServices.ActiveDirectory.DirectoryServer -> int
Public Function IndexOf (server As DirectoryServer) As Integer

参数

server
DirectoryServer

要在此集合中搜索的 DirectoryServer 对象。The DirectoryServer object to search for in this collection.

返回

Int32

第一个匹配对象的从零开始的索引。The zero-based index of the first matching object. 如果此集合的任何成员均不同于 DirectoryServer 对象,则返回 -1。Returns -1 if no member of this collection is identical to the DirectoryServer object.

例外

调用基础目录服务导致错误。A call to the underlying directory service resulted in an error.

servernullserver is null.

尚未将 DirectoryServer 对象保存到 Active Directory 域服务存储区中。The DirectoryServer object has not yet been saved in the Active Directory Domain Services store.

适用于

另请参阅