2012-01-31 50 views
0

我正在关注MSDN的演练Creating a Web Site with Membership and User LoginASP.NET配置成员资格用户要求

我已完成配置成员资格部分,我刚刚测试过它。

用户名和密码的要求比我们公司要求的更严格,所以我需要知道去哪里设置这些要求。

当前的错误是:

密码长度最小值:7所需的非字母数字字符:1.

在哪里设置这些要求?

Password length minimum Non-alphanumeric characters required

编辑:

下面是默认Web.config文件,微软创建每当我创造了这个Web应用程序。

<?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> 
    <roleManager enabled="true" /> 
    <authentication mode="Forms" /> 
    <compilation debug="true" targetFramework="4.0" /> 
    </system.web> 
</configuration> 

不知何故,有一个数据库连接字符串在所有这些,但我当然没有看到它。

我的ASP.NET提供程序是AspNetSqlProvider,测试成功......但我不知道这个数据库在哪里。我在我的项目中看不到它。

AspNetSqlProvider Screenshot

+0

FYI:[链接169433(http://go.microsoft.com/fwlink/?LinkId = 169433)将您带到一个关于ASP.net的完整在线书籍,该链接将涵盖链接。 – jp2code 2012-01-31 21:14:43

回答

1

你可以在你的web应用程序的web.config设置...

<membership> 
    <providers> 
    <clear/> 
    <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" 
     connectionStringName="connName" 
     requiresQuestionAndAnswer="false" 
     requiresUniqueEmail="true" 
     passwordFormat="Hashed" 
     minRequiredNonalphanumericCharacters="0" 
     minRequiredPasswordLength="5" /><!-- set password length here --> 
    </providers> 
    </membership> 
+0

因此,每当我通过'localhost'调试我的web应用时,将使用我的Visual Studio项目的'Web.config'中的这个值? [仍然是Noobie。我不舒服,但测试项目中的配置文件如何改变在调试过程中'localhost'的运行方式。] – jp2code 2012-01-31 19:30:02

+0

这可以配置开箱即用的'SqlMembershipProvider'和相应的设置... – xandercoded 2012-01-31 19:55:53

+0

我在哪里可以找到我的'connectionStringName'值? – jp2code 2012-01-31 20:06:43