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

编程入门 行业动态 更新时间:2024-10-24 01:52:44
本文介绍了自定义角色和身份验证提供程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个名为College的数据库 在原则"和讲座和学生"中,用户是用户,这意味着我们具有三个级别的身份验证 我将aspner_reqsql用于成员角色和规则 这意味着我将自己的角色和规则附加到了大学数据库中 但是当我单击asp配置时 (在解决方案资源管理器中)它将创建名为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 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}

" 要求问题和答案 =" false" requiresuniqueemail =" true" 最小密码长度 =" 6" 必需的非字母数字字符 =" 0" 密码格式 =" 哈希" / > < /提供者 > < /成员身份 > < 个人资料 已启用 =" true" 默认提供程序 =" > SQLProfileProvider" > < 提供者 > < 添加 名称 =" SQLProfileProvider" 类型 =" System.Web .Profile.SqlProfileProvider" 连接字符串名 =" PMDb" 应用程序名称 =" Port80Upload" / > < /提供者 > < /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

更多推荐

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

本文发布于:2023-11-04 00:53:55,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1556516.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:自定义   身份验证   角色   程序

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!