English 中文(简体)
ASP. 网上会员资格网
原标题:ASP.Net c# Membership provider <add name> attributes in web.config

我试图在成员提供人的“<><><>>><>>>部分中添加属性,但英特尔利森xe似乎不支持这些属性;我想补充的是:

  1. minReqiredNonalphanumericCharacters
  2. maxInvalidPasswordAttempts
  3. requiresUniqueEmail

下面是网站。 提前感谢。

<?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=SFPSFP_SQL_SVR;attachdbfilename=C:UsersSusanDocumentsDatabasesRestaurants.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=SFPSFP_SQL_SVR;attachdbfilename=C:UsersSusanDocumentsDatabasesRestaurants.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>
问题回答

暂无回答




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签