角色提供程序


继承自:System.web.Security.RoleProvider抽象类提供了角色提供者。

.net2.0之后就提供了RoleProvider类的具体实现,有两种:
AuthorizationStoreRoleProvider他把授权存储到Authorization store中、
另一个实现是SqlRoleProvider使用sqlserver存储角色信息。

如果我们对这两种情况都不是很满意,可以比较容易的实现自己的角色提供程序。虽然它在system.web
命名空间下,但在其他程序中都可以用。

静态类System.web.Security.Roles为角色提供管理提供了另一层封装。
他隐藏了对角色提供程序的操作。

但在配置文件中,<System.web>
<RoleManager defaultProvider="你的提供者实现"
enableed="true"
cacheRolesInCookie="true"
cookieName=".aspRoles"
cookieTimeOut="30"
cookiePath="/"
cookieRequireSSL="false"
cookeSlidingExpiration="true"
cookeiProtection="All">
<providers>
<clear/>
<add
name="你的提供者实现"
type="System.web.Security.AtuhorizationStroeRoleProvider"
connectionName="Sameple"
cacheRefreshInterval="60"
scopName=""/>
</providers>
</RoleManager>
</System.web>
</Configuration>


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值