自定义角色和身份验证提供程序

问题描述:

我有一个名为College的数据库
在原则"和讲座和学生"中,用户是用户,这意味着我们具有三个级别的身份验证
我将aspner_reqsql用于成员角色和规则
这意味着我将自己的角色和规则附加到了大学数据库中
但是当我单击asp.net配置时
(在解决方案资源管理器中)它将创建名为aspnetdb的新数据库,当我创建新用户时,这些新用户将存储在该数据库中,如何使用我自己的数据库而不是aspnetdb

I have a database with the name College
In that Principle and Lectures and Students are the users that means we have three levels of authentication
i used aspner_reqsql for member roles and rules
that means i attached my roles and rulle to College database
but when i click on asp.net Configuration
(at Solution Explorer) it creates new database with the name aspnetdb and when i creates new users those will be stored on that database how to use my own database instead of aspnetdb

您好,

首先,您将创建的数据库的脚本带入数据库中,并在web.config文件中更新您的成员资格部分.

Hi,

First you take the script of the created db and run that script into your database and update your membership section in the web.config file.

	<membership defaultprovider="SQLMembershipProvider" userisonlinetimewindow="15">
			<providers>
				<clear />
				<add name="SQLMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionstringname="PMSoftDb" applicationname="Port80Upload" enablepasswordretrieval="false" enablepasswordreset="true" passwordstrengthregularexpression="([a-zA-Z])(?=.*\d)\w{4,9}


" 要求问题和答案 =" requiresuniqueemail =" true" 最小密码长度 =" 必需的非字母数字字符 =" 密码格式 =" / > < /提供者 > < /成员身份 > < 个人资料 =" true" 默认提供程序 > SQLProfileProvider" > < 提供者 > < 添加 =" SQLProfileProvider" 类型 System.Web .Profile.SqlProfileProvider" 连接字符串名 PMDb" 应用程序名称 =" > < /提供者 > < /profile >
" requiresquestionandanswer="false" requiresuniqueemail="true" minrequiredpasswordlength="6" minrequirednonalphanumericcharacters="0" passwordformat="Hashed" /> </providers> </membership> <profile enabled="true" defaultprovider="SQLProfileProvider"> <providers> <add name="SQLProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionstringname="PMDb" applicationname="Port80Upload" /> </providers> </profile>


另外,您还应该在web.config


Also you should set connection string in the web.config