简体   繁体   English

ASP.Net C#成员资格提供程序 <add name> web.config中的属性

[英]ASP.Net c# Membership provider <add name> attributes in web.config

I have tried to add attributes to the " add name " section of the membership provider but Intellisenxe does not seem to support them> Some of the attributes I would like to add are: 我试图将属性添加到成员资格提供程序的“ 添加名称 ”部分,但是Intellisenxe似乎不支持它们>我想添加的一些属性是:

  1. minReqiredNonalphanumericCharacters minReqiredNonalphanumericCharacters
  2. maxInvalidPasswordAttempts maxInvalidPasswordAttempts
  3. requiresUniqueEmail requireUniqueEmail

Below is the web.config. 以下是web.config。 Thanks in advance. 提前致谢。

<?xml version="1.0"?>

<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->

<configuration>
    <system.web>
        <compilation debug="true" targetFramework="4.0" />

      <roleManager enabled="true"
                 defaultProvider="CustomizedRoleProvider">
        <providers>
          <add name="CustomizedRoleProvider"
               type="System.Web.Security.SqlRoleProvider"
               connectionStringName="RestaurantDB" />
        </providers>
      </roleManager>

      <membership defaultProvider="CustomizedMembershipProvider">
        <providers>
          <add name="CustomizedMembershipProvider" 
               minRequiredPasswordLength="6" 
               type="System.Web.Security.SqlMembershipProvider"
               connectionStringName="RestaurantDB" />
        </providers>
      </membership>      
    </system.web>

  <appSettings>

  </appSettings>

  <connectionStrings>
    <add name="RestaurantDB" connectionString="data source=SFP\SFP_SQL_SVR;attachdbfilename=C:\Users\Susan\Documents\Databases\Restaurants.mdf;Integrated Security=SSPI;"/>
    <add name="RestaurantsEntities" connectionString="metadata=res://*/Restaurant.csdl|res://*/Restaurant.ssdl|res://*/Restaurant.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=SFP\SFP_SQL_SVR;attachdbfilename=C:\Users\Susan\Documents\Databases\Restaurants.mdf;integrated security=True;multipleactiveresultsets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
  </connectionStrings>



</configuration>

try this: 尝试这个:

<configuration>
        ...
        <system.web>
            ...

                <membership 
                 defaultProvider="SqlProvider" userIsOnlineTimeWindow="20">
                 <providers>
                    <clear/>
                    <add name="SqlProvider"
                        type="System.Web.Security.SqlMembershipProvider"
                        connectionStringName="LocalSqlServer"
                        enablePasswordReset="true"
                        requiresQuestionAndAnswer="false"
                        requiresUniqueEmail="false" />
                        maxInvalidPasswordAttempts="5"
                        passwordAttemptWindow="10"
                        passwordFormat="Hashed"
                        minRequiredPasswordLength="7"
                        minRequiredNonAlphanumericCharacters="0"
                        passwordStrengthReqularExpression="0"
                        enablePasswordRetrieval="false"
                        applicationName="/" />
                </providers>
            </membership>
            ...
        </system.web>
        ...
    </configuration>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM