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

推荐订阅源

M
MIT News - Artificial intelligence
AI
AI
月光博客
月光博客
爱范儿
爱范儿
博客园 - 司徒正美
Last Week in AI
Last Week in AI
博客园 - 三生石上(FineUI控件)
S
Security @ Cisco Blogs
腾讯CDC
W
WeLiveSecurity
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Help Net Security
Help Net Security
人人都是产品经理
人人都是产品经理
WordPress大学
WordPress大学
Cyberwarzone
Cyberwarzone
K
Kaspersky official blog
Security Latest
Security Latest
博客园 - 叶小钗
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
A
Arctic Wolf
C
Cisco Blogs
H
Heimdal Security Blog
雷峰网
雷峰网
阮一峰的网络日志
阮一峰的网络日志
Google DeepMind News
Google DeepMind News
小众软件
小众软件
T
Tenable Blog
Attack and Defense Labs
Attack and Defense Labs
N
News and Events Feed by Topic
The Last Watchdog
The Last Watchdog
V2EX - 技术
V2EX - 技术
Simon Willison's Weblog
Simon Willison's Weblog
Vercel News
Vercel News
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
V
Vulnerabilities – Threatpost
L
LangChain Blog
Y
Y Combinator Blog
V
V2EX
Hacker News - Newest:
Hacker News - Newest: "LLM"
Latest news
Latest news
D
Docker
AWS News Blog
AWS News Blog
Google Online Security Blog
Google Online Security Blog
H
Help Net Security
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
T
Troy Hunt's Blog
TaoSecurity Blog
TaoSecurity Blog
Cloudbric
Cloudbric
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC

博客园 - 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 Pages
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>