DirectoryServerCollection.Contains(DirectoryServer) 方法

定义

确定指定的 DirectoryServer 对象是否在此集合中。Determines if the specified DirectoryServer object is in this collection.

public:
 bool Contains(System::DirectoryServices::ActiveDirectory::DirectoryServer ^ server);
public bool Contains (System.DirectoryServices.ActiveDirectory.DirectoryServer server);
member this.Contains : System.DirectoryServices.ActiveDirectory.DirectoryServer -> bool
Public Function Contains (server As DirectoryServer) As Boolean

参数

server
DirectoryServer

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

返回

Boolean

如果 DirectoryServer 对象处于此集合中,则为 true;否则为 falsetrue if the DirectoryServer object is in this collection; otherwise, false.

例外

对基础目录服务的调用导致了错误。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.

适用于

另请参阅