ActiveDirectorySiteCollection.Add(ActiveDirectorySite) 方法

定义

将指定 ActiveDirectorySite 对象追加到此集合中。Appends the specified ActiveDirectorySite object to this collection.

public:
 int Add(System::DirectoryServices::ActiveDirectory::ActiveDirectorySite ^ site);
public int Add (System.DirectoryServices.ActiveDirectory.ActiveDirectorySite site);
member this.Add : System.DirectoryServices.ActiveDirectory.ActiveDirectorySite -> int
Public Function Add (site As ActiveDirectorySite) As Integer

参数

site
ActiveDirectorySite

要追加到此集合的 ActiveDirectorySite 对象。The ActiveDirectorySite object to append to this collection.

返回

Int32

追加到此集合的 ActiveDirectorySite 对象的从零开始的索引。The zero-based index of the ActiveDirectorySite object that is appended to this collection.

例外

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

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

sitenullsite is null.

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

适用于

另请参阅