PrincipalContext 类

定义

封装对其执行所有操作的服务器或域、用作这些操作的基础的容器和用于执行这些操作的凭据。Encapsulates the server or domain against which all operations are performed, the container that is used as the base of those operations, and the credentials used to perform the operations.

public ref class PrincipalContext : IDisposable
[System.Security.SecurityCritical(System.Security.SecurityCriticalScope.Everything)]
public class PrincipalContext : IDisposable
type PrincipalContext = class
    interface IDisposable
Public Class PrincipalContext
Implements IDisposable
继承
PrincipalContext
属性
实现

注解

对于搜索操作, 主体上下文定义搜索基础, 对于插入操作, 上下文定义要插入对象的容器。For search operations, the principal context defines the search base, and for insert operations the context defines the container into which the object is inserted.

构造函数

PrincipalContext(ContextType)

使用指定的上下文类型初始化 PrincipalContext 类的新实例。Initializes a new instance of the PrincipalContext class with the specified context type.

PrincipalContext(ContextType, String)

使用指定的上下文类型和名称初始化 PrincipalContext 类的新实例。Initializes a new instance of the PrincipalContext class with the specified context type and name.

PrincipalContext(ContextType, String, String)

使用指定的上下文类型、名称和容器初始化 PrincipalContext 类的新实例。Initializes a new instance of the PrincipalContext class with the specified context type, name, and container.

PrincipalContext(ContextType, String, String, ContextOptions)

使用指定的上下文类型、名称、容器和上下文选项初始化 PrincipalContext 类的新实例。Initializes a new instance of the PrincipalContext class with the specified context type, name, container, and context options.

PrincipalContext(ContextType, String, String, ContextOptions, String, String)

使用指定的上下文类型、名称、容器、上下文选项、用户名和密码初始化 PrincipalContext 类的新实例。Initializes a new instance of the PrincipalContext class with the specified context type, name, container, context options, username, and password.

PrincipalContext(ContextType, String, String, String)

使用指定的上下文类型、名称、用户名和密码初始化 PrincipalContext 类的新实例。Initializes a new instance of the PrincipalContext class with the specified context type, name, username, and password.

PrincipalContext(ContextType, String, String, String, String)

使用指定的上下文类型、名称、容器、用户名和密码初始化 PrincipalContext 类的新实例。Initializes a new instance of the PrincipalContext class with the specified context type, name, container, username, and password.

属性

ConnectedServer

获取主体上下文连接到的服务器的名称。Gets the name of the server to which the principal context is connected.

Container

获取在构造函数的容器参数中指定的值。Gets the value specified in the container parameter in the constructor.

ContextType

获取上下文类型,该上下文类型指定主体上下文的存储区的类型。Gets the context type that specifies the type of store for the principal context.

Name

获取构造函数中指定作为 name 参数的值。Gets the value specified as the name parameter in the constructor.

Options

获取在构造函数的 contextOptions 参数中指定的选项。Gets the options specified in the contextOptions parameter of the constructor.

UserName

获取在构造函数的用户名参数中指定的值。Gets the value specified in the username parameter in the constructor.

方法

Dispose()

处置 PrincipalContext 对象的当前实例。Disposes the current instance of the PrincipalContext object.

Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetHashCode()

用作默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
ToString()

返回一个表示当前对象的 string。Returns a string that represents the current object.

(继承自 Object)
ValidateCredentials(String, String)

创建到服务器的连接并返回一个布尔值,该值指定所指定的用户名和密码是否有效。Creates the connections to the server and returns a Boolean value that specifies whether the specified username and password are valid.

ValidateCredentials(String, String, ContextOptions)

创建到服务器的连接并返回一个布尔值,该值指定所指定的用户名和密码是否有效。Creates the connections to the server and returns a Boolean value that specifies whether the specified user name and password are valid. 此方法对用户名和密码执行快速凭据验证。This method performs fast credential validation of the username and password.

适用于