ActiveDirectorySiteCollection.AddRange 方法

定义

将一个范围内的项追加到此集合中。Appends a range of items to this collection.

重载

AddRange(ActiveDirectorySite[])

将指定 ActiveDirectorySite 数组的内容追加到此集合中。Appends the contents of the specified ActiveDirectorySite array to this collection.

AddRange(ActiveDirectorySiteCollection)

将指定 ActiveDirectorySiteCollection 对象的内容追加到此集合中。Appends the contents of the specified ActiveDirectorySiteCollection object to this collection.

AddRange(ActiveDirectorySite[])

将指定 ActiveDirectorySite 数组的内容追加到此集合中。Appends the contents of the specified ActiveDirectorySite array to this collection.

public:
 void AddRange(cli::array <System::DirectoryServices::ActiveDirectory::ActiveDirectorySite ^> ^ sites);
public void AddRange (System.DirectoryServices.ActiveDirectory.ActiveDirectorySite[] sites);
member this.AddRange : System.DirectoryServices.ActiveDirectory.ActiveDirectorySite[] -> unit
Public Sub AddRange (sites As ActiveDirectorySite())

参数

sites
ActiveDirectorySite[]

ActiveDirectorySite 数组,包含要追加到此集合的对象。The ActiveDirectorySite array that contains the objects to append to this collection.

例外

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

集合中已存在该对象。The object already exists in the collection.

sitesnullsites is null.

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

另请参阅

适用于

AddRange(ActiveDirectorySiteCollection)

将指定 ActiveDirectorySiteCollection 对象的内容追加到此集合中。Appends the contents of the specified ActiveDirectorySiteCollection object to this collection.

public:
 void AddRange(System::DirectoryServices::ActiveDirectory::ActiveDirectorySiteCollection ^ sites);
public void AddRange (System.DirectoryServices.ActiveDirectory.ActiveDirectorySiteCollection sites);
member this.AddRange : System.DirectoryServices.ActiveDirectory.ActiveDirectorySiteCollection -> unit
Public Sub AddRange (sites As ActiveDirectorySiteCollection)

参数

sites
ActiveDirectorySiteCollection

ActiveDirectorySiteCollection 对象,包含要追加到此集合的对象。The ActiveDirectorySiteCollection object that contains the objects to append to this collection.

例外

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

此集合中已存在该对象。The object already exists in this collection.

sitesnullsites is null.

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

另请参阅

适用于