SqlProvider在web.config中的節點配置說明.

來源:互聯網
上載者:User
<membership defaultProvider="SqlProvider" userIsOnlineTimeWindow="15">
      <providers>

        <clear />

        <!--
          connectionStringName
          SQL SERVER的連接字串
          
          enablePasswordReset
          密碼能否重設
          安全原因,只有當
          
          
          requiresQuestionAndAnswer(false)
          設定為 true的時候
          你才可以設定enablePasswordReset為true
          requiresQuestionAndAnswer(false)
          是否需要啟用取回密碼
          
          applicationName(/)
          設定了它可以讓多個應用程式在資料庫內有所區分,
          不需要為每個應用建立一個資料庫了
          
          requiresUniqueEmail(false)
          郵件地址是否需要唯一
          
          maxInvalidPasswordAttempts(5)
          密碼輸入錯誤幾次就會鎖定使用者
          
          passwordAttemptWindow(10)
          每分鐘可以失敗的次數
          
          passwordFormat
          密碼方式 Clear, Encrypted,
          和Hashed. 第一種是明文儲存,
          效率比較高,但是SQL SERVER中能直接讀取密碼,
          不安全. 第二種是無法復原加密,
          需要一定的加密換算過程,
          但是比較安全.第三種是可逆加密,密碼不能找回
          
          minRequiredPasswordLength(7)
          指定至少密碼需要幾位
          
          minRequiredNonalphanumericCharacters(1)
          指定需要是非數字字母作為密碼的位元,
          不能大於minRequiredPasswordLength
          
          passwordStrengthRegularExpression("")
          指定強度計算的Regex
          
          enablePasswordRetrieval(false)
          如果為true表示可以獲得使用者的原密碼,
          但passwordFormat必須為Clear,以明文儲存到資料庫中.
          -->

        <add

          name="SqlProvider"

          type="System.Web.Security.SqlMembershipProvider"
            
          connectionStringName="aspnetdb"
            
          enablePasswordReset="true"
            
          requiresQuestionAndAnswer="true"

          applicationName="/NewTest"
            
          requiresUniqueEmail="true"
            
          passwordFormat="Hashed"
            
          minRequiredPasswordLength ="6"
            
          minRequiredNonalphanumericCharacters="0"
            
            />

      </providers>

    </membership>

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.