All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
在PWS上建立WAP网站_[XML教程]
.NET加密原理之方法体加密信息对应关系_.net资料_编程技术
Asp.NET大文件上传组件开发总结(三)---处理文件内容_[Asp.Net教程]
斜体样式的导航条_JavaScript技术_编程技术
在ASP.NET中访问SQL,2005报表服务_[Asp.Net教程]
asp.net判断页面加载所用时间_[Asp.Net教程]
php采用数据库保存session_php资料_编程技术
SQL注入技术和跨站脚本攻击的检测_[SQL,Server教程]
PHP脚本的8个技巧(2)会话用法_php资料_编程技术
[delphi语法9]delphi中with语句的使用实例
Reading number is top 10 pictures
Ashlynn Brooke photograph of a group1
Absolutely shocked. National geographic 50 animal photographys5
西游四格漫画(二)
Beauty shocked Japan Tokyo motor show model
青春清纯美女大集合3
Fierce! China's special forces training the devil2
Photographed the passion of the clients and prostitutes in the sex trade picture1
美女浴室写真1
开始让人感动,后来......
YangYuYing and ZhengShaoQiu dance on the generous come interest dye-in-the-wood
Download software ranking
Tram sex maniac 2 (H) rar bag3
DreamWeaver8
JSP+Ajax Web development typical examples
WebService在.NET中的实战应用教学视频 → 第2集
WebService在.NET中的实战应用教学视频 → 第1集
Tram sex maniac 2 (H) rar bag1
Unix video tutorial2
Sora aoi's film--cangkong_Blue.Sky
VeryCD电驴(EasyMule) V1.1.9 Build09081
jdk1.6 for windows
归海一刀 published in(发表于) 2014/1/30 1:57:33 Edit(编辑)
简单有效asp.net全部程序集权限配置_[Asp.Net教程]

简单有效asp.net全部程序集权限配置_[Asp.Net教程]

简单有效asp.net全部程序集权限配置_[Asp.Net教程]
web.config文件全部程序集权限进行配置

单个页面授权设置代码如下:













在Web程序里,每个根目录都有一个web.config。但一般的程序只有一个web.config配置文件。有多个文件夹里,子目录的web.config继承了母目录中的web.config。如果子母有冲突的话,则以子目录的web.config的规则为准。

一个网站不允许两种访问方式。

Context.User.Identity.Name;//用于获取当前用户名

Form的验证方式不理会Windows用户,全取决于你是否登录,写入Cookie。

using System.Web.Security;

FormAuthentication.RedirectFormLoginPage(string userName,bool createPersistentCookie)

//此方法将经过身份验证的用户重定向回最初请求的URL或默认的URL。

createPersistentCookie为true时则会创建一个Cookie。在Windows系统里C:\Documents and Settings\Administrator\Cookies路径可以找到。

Forms验证配置说明

loginUrl="login.aspx" [string] 指向登录页面。

defaultUrl="default.aspx" [string] 指定用户通过验证之后默认重定向的URL地址。

protection="All" [All | None |Encryption |Validation] 针对Cookie信息进行加密设置。

timeout="30" [in Minutes][number] 指定Cookie的有效期,以分钟为单位。

path="/" [string] 为由应用程序发出的Cookie指定路径。

requireSSL="false" [true | false] 指定是否使用安全套阶层(SSL)连接来传输身份验证Cookie。

slidingExpiration="true" [true |false] 指定是否启用滑动到期策略。

enableCrossAppRedirects="false" [true | false] 指定是否需要将通过身份验证的用户重定向到其他Web应用程序中URL。

Cookieless="UseDeviceProfile" [UseUri:指示不使用Cookie; |UseCookies:指示一定使用Cookie; |AutoDetect:指示根据浏览器具体情况使用Cookie或不使用; |UseDeviceProfile:与AutoDetect功能类似,但不会对浏览器进行检测其是否启用了Cookie。] 指定是否使用Cookie以及使用的方式。

domain=" " [string]
>

name="" [string,Required,Collection Key]
password="" [string,Required]
/>




FormsAuthenticationTicket
FormsAuthentication.Encrypt()
写入Cookie时,一定要写入时限。
如:
Cookie cook1=new Cookie();
cook1.Expires=DateTime.Now.AddDays(1);

网站有不同角色的用户,前台的用户不能访问后台,管理员哪个页面都可以访问。

在子文件Web.config里面如果有和同时存在时,必须在前面,否则deny会冲掉allow。


添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.