[ASP.NET 2.0 ]自定义role,Membership和profile数据库,在web.config中的写法
来源:互联网 发布:ios开发内存优化 编辑:程序博客网 时间:2024/05/21 17:05
一、Membership Provider
<configuration>
<connectionStrings>
<add name="SqlServices" connectionString="Data Source=MySqlServer;Integrated Security=SSPI;Initial Catalog=aspnetdb;" />
</connectionStrings>
<system.web>
<membership defaultProvider="SqlProvider" userIsOnlineTimeWindow="20">
<providers>
<remove name="AspNetSqlProvider" />
<add name="SqlProvider"
type="System.Web.Security.SqlMembershipProvider"
connectionStringName="SqlServices"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="true"
passwordFormat="Hashed"
applicationName="/" />
</providers>
</membership>
</system.web>
</configuration>
<connectionStrings>
<add name="SqlServices" connectionString="Data Source=MySqlServer;Integrated Security=SSPI;Initial Catalog=aspnetdb;" />
</connectionStrings>
<system.web>
<membership defaultProvider="SqlProvider" userIsOnlineTimeWindow="20">
<providers>
<remove name="AspNetSqlProvider" />
<add name="SqlProvider"
type="System.Web.Security.SqlMembershipProvider"
connectionStringName="SqlServices"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="true"
passwordFormat="Hashed"
applicationName="/" />
</providers>
</membership>
</system.web>
</configuration>
二、Role Provider
<configuration>
<connectionStrings>
<add name="SqlServices" connectionString="Data Source=MySqlServer;Integrated Security=SSPI;Initial Catalog=aspnetdb;" />
</connectionStrings>
<system.web>
<roleManager defaultProvider="SqlProvider"
enabled="true"
cacheRolesInCookie="true"
cookieName=".ASPROLES"
cookieTimeout="30"
cookiePath="/"
cookieRequireSSL="false"
cookieSlidingExpiration="true"
cookieProtection="Encrypted">
<providers>
<clear/>
<add
name="SqlProvider"
type="System.Web.Security.SqlRoleProvider"
connectionStringName="SqlServices"
applicationName="MyApplication" />
</providers>
</roleManager>
</system.web>
</configuration>
<connectionStrings>
<add name="SqlServices" connectionString="Data Source=MySqlServer;Integrated Security=SSPI;Initial Catalog=aspnetdb;" />
</connectionStrings>
<system.web>
<roleManager defaultProvider="SqlProvider"
enabled="true"
cacheRolesInCookie="true"
cookieName=".ASPROLES"
cookieTimeout="30"
cookiePath="/"
cookieRequireSSL="false"
cookieSlidingExpiration="true"
cookieProtection="Encrypted">
<providers>
<clear/>
<add
name="SqlProvider"
type="System.Web.Security.SqlRoleProvider"
connectionStringName="SqlServices"
applicationName="MyApplication" />
</providers>
</roleManager>
</system.web>
</configuration>
三、Profile
<configuration>
<connectionStrings>
<add name="SqlServices" connectionString=
"Data Source=MySqlServer;Integrated Security=SSPI;Initial Catalog=aspnetdb;" />
</connectionStrings>
<system.web>
<profile enabled="true" defaultProvider="SqlProvider">
<providers>
<clear />
<add name="SqlProvider"
type="System.Web.Profile.SqlProfileProvider"
connectionStringName="SqlServices"
applicationName="MyApplication" />
</providers>
</profile>
</system.web>
</configuration>
<connectionStrings>
<add name="SqlServices" connectionString=
"Data Source=MySqlServer;Integrated Security=SSPI;Initial Catalog=aspnetdb;" />
</connectionStrings>
<system.web>
<profile enabled="true" defaultProvider="SqlProvider">
<providers>
<clear />
<add name="SqlProvider"
type="System.Web.Profile.SqlProfileProvider"
connectionStringName="SqlServices"
applicationName="MyApplication" />
</providers>
</profile>
</system.web>
</configuration>
--------------------------------------------------------------------------------
参考资料:
http://msdn2.microsoft.com/zh-cn/library/system.web.security.membership.providers(VS.80).aspx
http://msdn2.microsoft.com/zh-cn/library/system.web.security.roles.providers(vs.80).aspx
http://msdn2.microsoft.com/zh-cn/library/system.web.profile.profilemanager.providers(VS.80).aspx
http://www.cnblogs.com/thcjp/archive/2006/11/19/565092.aspx
http://www.odetocode.com/Articles/427.aspx
http://www.odetocode.com/Articles/428.aspx
- [ASP.NET 2.0 ]自定义role,Membership和profile数据库,在web.config中的写法
- [ASP.NET 2.0 ]自定义role,Membership和profile数据库,在web.config中的写法
- [ASP.NET 2.0 ]自定义role,Membership和profile数据库,在web.config中的写法
- [ASP.NET 2.0 ]自定义role,Membership和profile数据库,在web.config中的写法
- Membership Role Profile-ASP.Net Configuration
- ASP.net Membership角色和权限(附WebPart在Web.config中的配置)
- Membership Role Profile数据库配置
- 在ASP.NET MVC2中使用自定义的AuthorizeAttribute绕过内置的Membership/Role机制
- 在ASP.NET MVC2中使用自定义的AuthorizeAttribute绕过内置的Membership/Role机制
- 考察ASP.NET 2.0的Membership, Roles和Profile
- 考察ASP.NET 2.0的Membership, Roles和Profile
- 在非SqlServer数据库上实现MemberShip和Role功能(自定义MemberShipProvider和RoleProvider)
- ASP.NET自定义Web.config中的Section
- 在SharePoint Server 2016 RC 中利用ASP.Net SQL MemberShip和Role Provider为Web Application配置Forms-based身份验证
- Professional ASP.NET 2.0 Security, Membership, and Role Management
- 在Asp.net中,Web.Config中 membership 及 roleManager 的配置:
- 考察ASP.NET 2.0中的Membership, Roles, and Profile - Part 5
- 【转贴】考察ASP.NET 2.0中的Membership, Roles, and Profile - Part 5
- Event属性:
- DotSharp1.1 .NET代码生成器
- AjaxServer1.0
- EasyEditor1.0
- 冰风多线程采集器1.0
- [ASP.NET 2.0 ]自定义role,Membership和profile数据库,在web.config中的写法
- 开博。。。
- 一年的三分之一行将结束,你作了些什么?
- Eclipse开发struts完全指南
- 初学者入门经典:Java环境配置大全
- 大阪第35天——日本人办事效率不是一般的差
- 解决 fedora 5 root 用户 vi 无法高亮显示问题
- 关于静态页面生成的研究
- FTP搜索引擎的设计与实现