DirectoryEntry 類別

定義

DirectoryEntry 類別會封裝 Active Directory 網域服務階層架構中的節點或物件。

public ref class DirectoryEntry : System::ComponentModel::Component
public class DirectoryEntry : System.ComponentModel.Component
[System.ComponentModel.TypeConverter(typeof(System.DirectoryServices.DirectoryEntryConverter))]
public class DirectoryEntry : System.ComponentModel.Component
[System.ComponentModel.TypeConverter(typeof(System.DirectoryServices.Design.DirectoryEntryConverter))]
public class DirectoryEntry : System.ComponentModel.Component
[System.ComponentModel.TypeConverter(typeof(System.DirectoryServices.Design.DirectoryEntryConverter))]
[System.DirectoryServices.DSDescription("DirectoryEntryDesc")]
public class DirectoryEntry : System.ComponentModel.Component
type DirectoryEntry = class
    inherit Component
[<System.ComponentModel.TypeConverter(typeof(System.DirectoryServices.DirectoryEntryConverter))>]
type DirectoryEntry = class
    inherit Component
[<System.ComponentModel.TypeConverter(typeof(System.DirectoryServices.Design.DirectoryEntryConverter))>]
type DirectoryEntry = class
    inherit Component
[<System.ComponentModel.TypeConverter(typeof(System.DirectoryServices.Design.DirectoryEntryConverter))>]
[<System.DirectoryServices.DSDescription("DirectoryEntryDesc")>]
type DirectoryEntry = class
    inherit Component
Public Class DirectoryEntry
Inherits Component
繼承
屬性

備註

使用此類別來系結至物件,或讀取和更新屬性。 DirectoryEntry以及協助程式類別,提供生命週期管理和導覽方法的支援。 其中包括建立、刪除、重新命名、移動子節點,以及列舉子節點。 修改節點之後,您必須認可變更,才能將它們儲存到樹狀結構。 如需詳細資訊,請參閱 CommitChanges 屬性 (Property)。

DirectoryEntry 可用來存取一般專案,以及來自架構專案但並非全部的資訊。

Active Directory 網域服務階層最多包含數千個節點。 每個節點都代表物件,例如網路印表機或網域中的使用者。 公司網路會隨著新員工雇用而不斷變更,並新增網路印表機和電腦等物件。 Active Directory 服務介面 (ADSI) 技術提供以程式設計方式將這些物件新增至目錄樹狀結構的方法。

若要在階層中建立目錄專案,請使用 Children 屬性。 屬性 Children 是提供方法的 Add 集合,可讓您直接將節點新增至目前系結至父節點下方的集合。 將節點新增至集合時,您必須指定新節點的名稱,以及您想要與節點建立關聯的架構範本名稱。 例如,您可能想要使用標題為 「電腦」的架構,將新電腦新增至階層。

這個類別也包含屬性快取,這對於優化網路流量很有用。 若要使用屬性快取,請參閱 UsePropertyCache 屬性。

與元件相關聯的 DirectoryEntry 類別可以與任何Active Directory 網域服務服務提供者搭配使用。 某些目前的提供者包括 Internet Information Services (IIS) 、輕量型目錄存取通訊協定 (LDAP) 、Novell NetWare Directory Service (NDS) 和 WinNT。

注意

假設您使用這個類別之前,您已大致瞭解Active Directory 網域服務。 如需詳細資訊,請參閱 System.DirectoryServices 命名空間概觀。

建構函式

DirectoryEntry()

初始化 DirectoryEntry 類別的新執行個體。

DirectoryEntry(Object)

初始化 DirectoryEntry 類別的新執行個體,這個執行個體繫結至指定的原生 Active Directory 網域服務物件。

DirectoryEntry(String)

初始化 DirectoryEntry 類別的新執行個體,這個執行個體繫結程序至位在指定路徑之 Active Directory 網域服務中的節點。

DirectoryEntry(String, String, String)

初始化 DirectoryEntry 類別的新執行個體。

DirectoryEntry(String, String, String, AuthenticationTypes)

初始化 DirectoryEntry 類別的新執行個體。

屬性

AuthenticationType

取得或設定所要使用的驗證類型。

CanRaiseEvents

取得值,指出元件是否能引發事件。

(繼承來源 Component)
Children

取得 Active Directory 網域服務階層架構中這個節點的子項目。

Container

取得包含 IContainerComponent

(繼承來源 Component)
DesignMode

取得值,指出 Component 目前是否處於設計模式。

(繼承來源 Component)
Events

取得附加在這個 Component 上的事件處理常式清單。

(繼承來源 Component)
Guid

取得 DirectoryEntry 的 GUID。

Name

取得以基礎目錄服務命名的物件名稱。

NativeGuid

取得 DirectoryEntry 的 GUID,這是提供者傳回的值。

NativeObject

取得原生 Active Directory Service Interfaces (ADSI) 物件。

ObjectSecurity

取得或設定這個項目的安全性描述元。

Options

取得這個項目的提供者特定選項。

Parent

取得 Active Directory 網域服務階層中這個項目的父系。

Password

設定要在驗證用戶端時使用的密碼。

Path

取得或設定這個 DirectoryEntry 的路徑。

Properties

取得這個 DirectoryEntry 物件的 Active Directory 網域服務屬性。

SchemaClassName

取得這個 DirectoryEntry 物件的結構描述類別名稱。

SchemaEntry

取得這個項目的結構描述物件。

Site

取得或設定 ComponentISite

(繼承來源 Component)
UsePropertyCache

取得或設定值,指出在每一項作業之後,是否應該認可快取。

Username

取得或設定要在驗證用戶端時使用的使用者名稱。

方法

Close()

關閉 DirectoryEntry 物件,並釋放與這個元件相關聯的任何系統資源。

CommitChanges()

將目錄項目的變更儲存至基礎目錄存放區。

CopyTo(DirectoryEntry)

建立這個項目的複本,以做為指定之父系的子系。

CopyTo(DirectoryEntry, String)

以指定的新名稱建立這個 DirectoryEntry 物件的複本,以做為指定之父 DirectoryEntry 物件的子系。

CreateObjRef(Type)

建立包含所有相關資訊的物件,這些資訊是產生用來與遠端物件通訊的所需 Proxy。

(繼承來源 MarshalByRefObject)
DeleteTree()

從 Active Directory 網域服務階層刪除這個項目及其整個子樹狀結構。

Dispose()

釋放 Component 所使用的所有資源。

(繼承來源 Component)
Dispose(Boolean)

處置 DirectoryEntry 所使用的資源 (記憶體除外)。

Equals(Object)

判斷指定的物件是否等於目前的物件。

(繼承來源 Object)
Exists(String)

決定指定的路徑是否表示目錄服務中的實際項目。

GetHashCode()

做為預設雜湊函式。

(繼承來源 Object)
GetLifetimeService()
已淘汰.

擷取控制這個執行個體存留期 (Lifetime) 原則的目前存留期服務物件。

(繼承來源 MarshalByRefObject)
GetService(Type)

傳回表示 Component 或其 Container 所提供之服務的物件。

(繼承來源 Component)
GetType()

取得目前執行個體的 Type

(繼承來源 Object)
InitializeLifetimeService()
已淘汰.

取得存留期服務物件,以控制這個執行個體的存留期原則。

(繼承來源 MarshalByRefObject)
Invoke(String, Object[])

在原生 Active Directory 網域服務物件上呼叫方法。

InvokeGet(String)

從原生 Active Directory 網域服務物件取得屬性。

InvokeSet(String, Object[])

在原生 Active Directory 網域服務物件上設定屬性。

MemberwiseClone()

建立目前 Object 的淺層複製。

(繼承來源 Object)
MemberwiseClone(Boolean)

建立目前 MarshalByRefObject 物件的淺層複本。

(繼承來源 MarshalByRefObject)
MoveTo(DirectoryEntry)

將這個 DirectoryEntry 物件移至指定的父系。

MoveTo(DirectoryEntry, String)

將這個 DirectoryEntry 物件移至指定的父系,並將其名稱變更為指定的值。

RefreshCache()

將這個 DirectoryEntry 物件的屬性值載入屬性快取中。

RefreshCache(String[])

將指定的屬性值載入屬性快取中。

Rename(String)

變更這個 DirectoryEntry 物件的名稱。

ToString()

傳回任何包含 Component 名稱的 String。 不應覆寫此方法。

(繼承來源 Component)

事件

Disposed

Dispose() 方法的呼叫處置元件時,就會發生。

(繼承來源 Component)

適用於