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 属性。

DirectoryEntry 可用于访问常规条目以及架构条目中的部分(但不是全部)信息。

Active Directory 域服务层次结构最多包含数千个节点。 每个节点表示一个对象,例如网络打印机或域中的用户。 随着新员工的招聘和添加网络打印机和计算机等对象,公司网络不断变化。 Active Directory 服务接口 (ADSI) 技术提供了以编程方式将这些对象添加到目录树的方法。

若要在层次结构中创建目录条目,请使用 Children 属性。 属性 Children 是一个提供 Add 方法的集合,通过该方法可将节点添加到当前绑定到的父节点正下方的集合中。 将节点添加到集合时,必须指定要与该节点关联的新节点的名称和架构模板的名称。 例如,你可能想要使用标题为“计算机”的架构向层次结构添加新计算机。

此类还包含属性缓存,这对于优化网络流量非常有用。 若要使用属性缓存,请参阅 UsePropertyCache 属性。

与组件关联的DirectoryEntry类可以与任何Active Directory 域服务服务提供商一起使用。 当前的一些提供程序包括 Internet Information Services (IIS) 、轻型目录访问协议 (LDAP) 、Novell NetWare 目录服务 (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 服务接口 (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)

创建一个对象,该对象包含生成用于与远程对象进行通信的代理所需的全部相关信息。

(继承自 MarshalByRefObject)
DeleteTree()

从 Active Directory 域服务层次结构中删除此项及其整个子树。

Dispose()

释放由 Component 使用的所有资源。

(继承自 Component)
Dispose(Boolean)

释放 DirectoryEntry 使用的资源(内存除外)。

Equals(Object)

确定指定对象是否等于当前对象。

(继承自 Object)
Exists(String)

确定指定路径是否表示目录服务实际项。

GetHashCode()

作为默认哈希函数。

(继承自 Object)
GetLifetimeService()
已过时.

检索控制此实例的生存期策略的当前生存期服务对象。

(继承自 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)

适用于