共用方式為


ActiveDirectorySubnetCollection.IndexOf(ActiveDirectorySubnet) 方法

定義

傳回這個集合中指定 ActiveDirectorySubnet 物件第一次出現的索引。

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

參數

subnet
ActiveDirectorySubnet

要在此集合中搜尋的 ActiveDirectorySubnet 物件。

傳回

第一個相符物件的以零起始的索引。 如果這個集合中沒有成員與 ActiveDirectorySubnet 物件相同,則傳回 -1。

例外狀況

呼叫基礎目錄服務時,發生錯誤。

subnetnull

ActiveDirectorySubnet 物件尚未儲存在 Active Directory 網域服務存放區中。

適用於

另請參閱