ReplicationConnectionCollection.IndexOf(ReplicationConnection) 方法

定义

返回指定的 ReplicationConnection 对象在此集合中的第一个匹配项的索引。Returns the index of the first occurrence of the specified ReplicationConnection object in this collection.

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

参数

connection
ReplicationConnection

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

返回

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

异常

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

connection 参数为 nullThe connection parameter is null.

指定的 connection 不存在。The specified connection does not exist.

适用于

另请参阅