DirectoryEntry.Parent DirectoryEntry.Parent DirectoryEntry.Parent DirectoryEntry.Parent Property

定義

取得 Active Directory 網域服務階層架構中這個項目的父代。Gets this entry's parent in the Active Directory Domain Services hierarchy.

public:
 property System::DirectoryServices::DirectoryEntry ^ Parent { System::DirectoryServices::DirectoryEntry ^ get(); };
[System.ComponentModel.Browsable(false)]
[System.DirectoryServices.DSDescription("DSParent")]
public System.DirectoryServices.DirectoryEntry Parent { get; }
member this.Parent : System.DirectoryServices.DirectoryEntry
Public ReadOnly Property Parent As DirectoryEntry

屬性值

DirectoryEntry 物件,表示這個項目的父代。A DirectoryEntry object that represents the parent of this entry.

範例

下列範例會搜尋指定DirectoryEntry的,並顯示結果的NameParentThe following example searches a given DirectoryEntry and displays the Name and Parent of the result.

Dim myADSPath As String = _   
          "LDAP://onecity/CN=user,CN=Users,DC=onecity,DC=corp,DC=fabrikam,DC=com"  
Dim myDirectoryEntry As New DirectoryEntry(myADSPath, UserName, SecurelyStoredPassword)  

Console.WriteLine("Parent is :" + myDirectoryEntry.Parent.Path)  
String myADSPath = "LDAP://onecity/CN=user,CN=Users,DC=onecity,DC=corp,DC=fabrikam,DC=com";  
DirectoryEntry myDirectoryEntry=new DirectoryEntry(myADSPath, UserName, SecurelyStoredPassword);  

Console.WriteLine("Parent is :"+myDirectoryEntry.Parent.Path);  
String^ myADSPath = "LDAP://onecity/CN=user,CN=Users,DC=onecity,DC=corp,DC=fabrikam,DC=com";  
DirectoryEntry^ myDirectoryEntry = gcnew DirectoryEntry(myADSPath, UserName, SecurelyStoredPassword);  

Console::WriteLine("Parent is :{0}", myDirectoryEntry->Parent->Path);  

安全性

DirectoryServicesPermission
以取得父系。To get the parent.

適用於