語言

ActiveDirectoryMembershipProvider.Initialize 方法

定義

以應用程式設定檔中的屬性值初始化實 ActiveDirectoryMembershipProvider 例。 這個方法並非設計用來從你的程式碼中呼叫。

public:
 override void Initialize(System::String ^ name, System::Collections::Specialized::NameValueCollection ^ config);
public override void Initialize(string name, System.Collections.Specialized.NameValueCollection config);
override this.Initialize : string * System.Collections.Specialized.NameValueCollection -> unit
Public Overrides Sub Initialize (name As String, config As NameValueCollection)

參數

name
String

要初始化的實例名稱 ActiveDirectoryMembershipProvider 。

config
NameValueCollection

A NameValueCollection 包含會員提供者設定選項的名稱與值。

例外狀況

config 是 null。

applicationName應用程式設定中指定的屬性超過 256 個字元。

-或-

connectionStringName該屬性為空或在應用程式設定中不存在。

-或-

應用程式設定檔中 connectionStringName 屬性中指定的連接字串為空或不存在。

-或-

屬性connectionProtection會被設定為應用程式設定檔中以外的SignAndSealNone其他值。

-或-

connectionUsername該屬性在應用程式設定檔中指定,但其值為空。

-或-

connectionPassword該屬性在應用程式設定檔中指定,但其值為空。

-或-

應用程式設定檔中指定屬性或 connectionUsername 屬性 connectionPassword ,但不會同時指定兩者。

-或-

clientSearchTimeout屬性被指定,但並非正整數。

-或-

serverSearchTimeout屬性被指定,但並非正整數。

-或-

enableSearchMethods屬性有指定,但並非布林值。

-或-

requiresUniqueEmail屬性有指定,但並非布林值。

-或-

enablePasswordReset屬性有指定,但並非布林值。

-或-

requiresQuestionAndAnswer屬性有指定,但並非布林值。

-或-

minRequiredPasswordLength屬性被指定為負值或大於128。

-或-

minRequiredNonalphanumericCharacters屬性被指定為負值或大於128。

-或-

應用程式設定檔中 passwordStrengthRegularExpression 屬性中指定的正規表達式並非有效的正規表達式

-或-

attributeMapUsername屬性被指定,但它是一個空字串。

-或-

屬性 connectionString 不以「LDAP」開頭。

-或-

connectionString 屬性中指定的連接字串無效。

-或-

connectionString 屬性中的 連接字串 指定了無伺服器綁定。

-或-

他們 ActiveDirectoryMembershipProvider 無法與網域或目錄伺服器建立連線。

-或-

connectionProtection屬性設定為 SignAndSeal,但無法與伺服器建立 SSL 或簽署封存的連線。

-或-

connectionProtection屬性設定為 ,None但 connectionUsername 和 connectionPassword 屬性並未設定。

-或-

connectionProtection屬性設定為 ,SignAndSeal但無法ActiveDirectoryMembershipProvider與 ADAM 伺服器建立 SSL 連線。

-或-

屬性 connectionString 指定全球目錄(GC)或 SSL 全球目錄埠。

-或-

connectionString 屬性指定Active Directory伺服器或網域,但 ActiveDirectoryMembershipProvider 無法取得該網域的預設命名上下文。

-或-

connectionString 屬性指定Active Directory伺服器或網域,但 ActiveDirectoryMembershipProvider 無法取得預設使用者容器。

-或-

屬性 connectionString 指定 ADAM 伺服器,但未指定應用程式分割區或容器。

-或-

屬性 connectionString 指定了一個應用程式分割區或容器,但指定的容器並不存在。

-或-

屬性 connectionString 指定一個容器,不允許包含使用者實例。

指定了一個屬性映射,但其值為空。

-或-

屬性映射會指定兩次。

-或-

雖然指定了屬性映射,但該屬性不存在於使用者實例中。

-或-

雖然指定了屬性映射,但目錄屬性並非正確的資料型別。

-或-

屬性映射被指定,但目錄屬性是多值的。

-或-

attributeMapUserName 屬性被指定,但在連接 Active Directory 時,既未映射到 sAMAccountName 也未映射到 userPrincipalName 目錄屬性。

-或-

attributeMapUserName該屬性被指定,但連接 ADAM 伺服器時並未映射到userPrincipalName目錄屬性。

-或-

屬性 enablePasswordReset 為 , true 屬性 requiresQuestionAndAnswer 則在 false 應用程式設定檔中。

-或-

maxInvalidPasswordAttempts該屬性被指定,但並非非零正整數。

-或-

passwordAttemptWindow該屬性被指定,但並非非零正整數。

-或-

passwordAnswerAttemptLockoutDuration該屬性被指定,但並非非零正整數。

-或-

屬性enablePasswordReset為true,且任意attributeMapFailedPasswordAnswerCountattributeMapFailedPasswordAnswerTimeattributeMapFailedPasswordAnswerLockoutTime、、 和 屬性皆為空。

-或-

requiresQuestionAndAnswer屬性是true,但要麼attributeMapPasswordQuestionattributeMapPasswordAnswer是空的。

-或-

應用程式設定檔中指定的屬性無效。

應用程式運行於託管環境中,且 設定 AspNetHostingPermissionLevel 為 Minimal。

查詢目錄時發生錯誤。

備註

此方法初始化 ActiveDirectoryMembershipProvider 物件,並依照 ASP.NET 應用程式設定檔(Web.config)中指定的屬性值,並非直接從程式碼中使用。

適用於

另請參閱