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

推荐订阅源

P
Privacy & Cybersecurity Law Blog
V
V2EX
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
The Register - Security
The Register - Security
MongoDB | Blog
MongoDB | Blog
P
Privacy International News Feed
The Last Watchdog
The Last Watchdog
Security Archives - TechRepublic
Security Archives - TechRepublic
美团技术团队
Stack Overflow Blog
Stack Overflow Blog
博客园 - 司徒正美
博客园 - 三生石上(FineUI控件)
V
Visual Studio Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
K
Kaspersky official blog
S
Secure Thoughts
T
Tenable Blog
Security Latest
Security Latest
The Cloudflare Blog
S
Security @ Cisco Blogs
H
Heimdal Security Blog
aimingoo的专栏
aimingoo的专栏
TaoSecurity Blog
TaoSecurity Blog
Blog — PlanetScale
Blog — PlanetScale
Microsoft Security Blog
Microsoft Security Blog
Schneier on Security
Schneier on Security
Webroot Blog
Webroot Blog
G
Google Developers Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Scott Helme
Scott Helme
IT之家
IT之家
Latest news
Latest news
The Hacker News
The Hacker News
C
Check Point Blog
T
The Exploit Database - CXSecurity.com
H
Hackread – Cybersecurity News, Data Breaches, AI and More
腾讯CDC
C
CERT Recently Published Vulnerability Notes
NISL@THU
NISL@THU
N
News | PayPal Newsroom
Forbes - Security
Forbes - Security
P
Palo Alto Networks Blog
S
Security Affairs
S
Securelist
Google Online Security Blog
Google Online Security Blog
WordPress大学
WordPress大学
Last Week in AI
Last Week in AI
C
Cybersecurity and Infrastructure Security Agency CISA
A
About on SuperTechFans

博客园 - J. Lin

据可靠小道消息VS 2008 SP1 RTM 将在下周一发布 Configuration Section Designer 自定义配置设计器 Linq to Sql: 批量删除之投机取巧版 [CSS Hack] border-color:transparent & filter+ClearType bug ASP.NET AJAX 1.0 & AJAX Control Toolkit 在iframe中的"access denied"错误 Aptana使用入门一:Code Assist What we can do in "Page" class 页面基类功能扩展汇总 不可多得的Javascript(AJAX)开发工具 - Aptana 右键菜单快速打开VS 2005 Website项目 SQL Server 2005 SP1 安装问题 设置asp.net程序在web.config被修改后是否重启 VS2005 Add-in:CSS Properties Window 在MastPage中引用脚本资源 Design Templates for ASP.NET 2.0 Security Guidelines: ASP.NET 2.0 [目录] & [How to列表] ASP.NET 2.0 Security FAQs 翻译计划 [ASP.NET 2.0 Security FAQs]如何在membership中强制使用高安全性的密码 Web.config 文件中的“智能感知” 用宏自动生成Web.sitemap文件(ASP.NET 2.0)
[ASP.NET 2.0 Security FAQs]如何设置SQL Server或SQL Express数据库,使其支持Membership、Profiles和Role
J. Lin · 2005-12-10 · via 博客园 - J. Lin

[ASP.NET 2.0 Security FAQs]目录

原文链接

翻译:2005-12-10   by Jackei Lin

ASP.NET 2.0 中的Membership, Profiles 和Role需要把相关信息存储到数据源中. 这几项特性的默认的provider分别是 SqlMembershipProvider, SqlProfileProvider 和 SqlRoleProvider.

如果你没有配置使用特别的provider, 你的程序就会使用以上默认的provider. 当你的程序第一次调用某个默认的provider时, ASP.NET会自动在App_Data 目录下新建一个SQL Express database用于存储所需的信息.

如果你想使用特定的SQL Server或SQL Express database server, 你必须配置你的程序以提供provider 所需的调用特定数据库的信息. 除此之外你必须配置相关的数据库.

使用Aspnet_regsql.exe来创建或配置特定的数据库.例如, 在命令行工具(cmd)里执行如下的指令:

 aspnet_regsql -S (local) -E -A mpr

-S  指派特定的数据库服务器, 在这个例子里是(local).

-E  使用Windows信任连接连接相关SQL Server服务器.

-A mpr  添加相关支持,为:m: membership,p: profiles, r: roles.

执行Aspnet_regsql /?,你可以得到所有相关命令的列表.

Aspnet_regsql 配置成功的aspnetdb(或其他)数据库是使用数据库角色(database roles)来控制书库访问的. 你必须让运行ASP.NET 程序的帐号能够访问aspnetdb数据库,这样你的程序才能使用数据库中的相关信息. 例如, 在SQL Query Analyzer里执行以下语句,使Network Service帐号能够造作相关的数据:

 --为Network Service帐号创建一个SQL Server登陆
 sp_grantlogin 'NT AUTHORITY\Network Service'
 --允许帐号访问membership数据库
 USE aspnetdb
 GO
 sp_grantdbaccess 'NT AUTHORITY\Network Service', 'Network Service'
 --把用户添加到数据角色
 USE aspnetdb
 GO
 sp_addrolemember 'aspnet_Membership_FullAccess', 'Network Service'

译者注:aspnet_regsql.exe位于C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727 目录下,它还可以用来配置数据库以用于存储session。

其他相关资料:
Configuring ASP.NET 2.0 Application Services to use SQL Server 2000 or SQL Server 2005  by Scott Guthrie
中文:将 ASP.NET 2.0 应用程序服务配置为使用 SQL Server 2000 或 SQL Server 2005