PrincipalContext PrincipalContext PrincipalContext PrincipalContext Class

定義

封裝用以執行所有作業的伺服器或網域、這些作業的基底容器,以及作業執行時使用的認證。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
繼承
PrincipalContextPrincipalContextPrincipalContextPrincipalContext
屬性
實作

備註

搜尋作業的主體的內容定義搜尋基底,並插入作業的內容會定義要插入之物件的容器。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(ContextType) PrincipalContext(ContextType) PrincipalContext(ContextType)

使用指定的內容型別,初始化 PrincipalContext 類別的新執行個體。Initializes a new instance of the PrincipalContext class with the specified context type.

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

使用指定的內容型別和名稱,初始化 PrincipalContext 類別的新執行個體。Initializes a new instance of the PrincipalContext class with the specified context type and name.

PrincipalContext(ContextType, String, String) PrincipalContext(ContextType, String, String) PrincipalContext(ContextType, String, String) 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(ContextType, String, String, ContextOptions) PrincipalContext(ContextType, String, String, ContextOptions) 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(ContextType, String, String, ContextOptions, String, String) PrincipalContext(ContextType, String, String, ContextOptions, String, String) 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(ContextType, String, String, String) PrincipalContext(ContextType, String, String, String) 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(ContextType, String, String, String, String) PrincipalContext(ContextType, String, String, String, String) 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 ConnectedServer ConnectedServer ConnectedServer

取得主體內容所連接之伺服器的名稱。Gets the name of the server to which the principal context is connected.

Container Container Container Container

取得建構函式中之容器參數指定的值。Gets the value specified in the container parameter in the constructor.

ContextType ContextType ContextType ContextType

取得內容型別,這個內容型別指定主體內容的存放區型別。Gets the context type that specifies the type of store for the principal context.

Name Name Name Name

取得建構函式中以 name 參數指定的值。Gets the value specified as the name parameter in the constructor.

Options Options Options Options

取得建構函式的 contextOptions 參數中指定的選項。Gets the options specified in the contextOptions parameter of the constructor.

UserName UserName UserName UserName

取得建構函式中之使用者名稱參數指定的值。Gets the value specified in the username parameter in the constructor.

方法

Dispose() Dispose() Dispose() Dispose()

處置 PrincipalContext 物件目前的執行個體。Disposes the current instance of the PrincipalContext object.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(Inherited from Object)
ValidateCredentials(String, String) ValidateCredentials(String, String) ValidateCredentials(String, String) 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) ValidateCredentials(String, String, ContextOptions) ValidateCredentials(String, String, ContextOptions) 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.

適用於