惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

C
Check Point Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
L
LangChain Blog
云风的 BLOG
云风的 BLOG
M
MIT News - Artificial intelligence
A
About on SuperTechFans
J
Java Code Geeks
量子位
博客园 - 三生石上(FineUI控件)
博客园 - Franky
博客园_首页
H
Hackread – Cybersecurity News, Data Breaches, AI and More
IT之家
IT之家
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Apple Machine Learning Research
Apple Machine Learning Research
Engineering at Meta
Engineering at Meta
雷峰网
雷峰网
D
DataBreaches.Net
人人都是产品经理
人人都是产品经理
Martin Fowler
Martin Fowler
有赞技术团队
有赞技术团队
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻

博客园 - rabbler

利用脚本禁止与启动Microsoft SQL Server相关服务 [译]Creating a Stock Widget in ASP.NET MVC Application DOM Document Object properties & DOM Element properties A-Grade Browser By Yahoo asp.net mvc 2.0 validate model asp.net mvc 2.0 Strongly-Typed HTML Helper Javascript code prettifier YUI3学习路线 Asp.net MVC 常用控件 Ubuntu 常用命令收集[菜鸟版] How to use JabRef (BibTeX) with Microsoft Word SQL Server 2008 sp1 集成安装 - rabbler Web Design: CSS Tutorials Bart's PE - rabbler - 博客园 Portal课题的相关词汇 计算机核心期刊一览 IE8 Beta2 安装与卸载之旅 水晶报表的使用 如何提高Asp.net2.0的效率
Using Asp.net Membership and RoleProvider to Build Login ...
rabbler · 2008-11-10 · via 博客园 - rabbler

Long story short, make steps by followed.

Step1: 创建一个新的数据库,目前主流的数据库仍然是SqlServer2005,就使用这个。属性更改为Chinese_RPC_CI_AS.

Note: Chinese_PRC_CS_AI_WS
前半部份:指UNICODE字符集,Chinese_PRC_指针对大陆简体字UNICODE的排序规则。
排序规则的后半部份即后缀 含义:
  _BIN 二进制排序
  _CI(CS) 是否区分大小写,CI不区分,CS区分
  _AI(AS) 是否区分重音,AI不区分,AS区分   
  _KI(KS) 是否区分假名类型,KI不区分,KS区分 
     _WI(WS) 是否区分宽度 WI不区分,WS区分 

Step2: 在Visual Studio的命令行窗口(Command Window)输入aspnet_regsql.exe进入配置aspnet数据库向导,在步骤中指向刚刚创建的数据库。这时候会创建一系列的表,这些表就是与membership相对应的表。

Note:aspnet_regsql.ext工具存放在%WINDIR%\Microsoft.Net\Framework\v2.0.50727\    目录下。

Step3: 在web.config 文件下添加以下内容。

在<configuration>标签里添加

<connectionStrings>
  <add name="testConnectionString" connectionString="Data Source=(local);Initial Catalog=test;Persist Security Info=True;User ID=sa;Password=123456"
   providerName="System.Data.SqlClient" />
</connectionStrings>

在<system.web>标签里添加

<membership defaultProvider="OwnMembershipProvider" >
  <providers>
    <clear />
    <add name="OwnMembershipProvider"
         type="System.Web.Security.SqlMembershipProvider"
         connectionStringName="testConnectionString"
         enablePasswordRetrieval="false"
         enablePasswordReset="true"
         requiresQuestionAndAnswer="true"
         applicationName="test"
         requiresUniqueEmail="true"
         passwordFormat="Hashed"
         maxInvalidPasswordAttempts="5"
         minRequiredPasswordLength="7"
         minRequiredNonalphanumericCharacters="1"
         passwordAttemptWindow="10"
         passwordStrengthRegularExpression="" />
  </providers>     
</membership>

Note: provide相应属性的说明如下:

1

2

Step4: 创建RoleManger。

在<system.web>标签里添加

<roleManager enabled="true" defaultProvider="AspNetSqlRoleProvider">
      <providers>
        <clear />
        <add name="AspNetSqlRoleProvider"
             connectionStringName="testConnectionString"
             applicationName="/"
             type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
      </providers>
    </roleManager>