摘要: 构建基于forms的验证机制过程如下: 1,设置IIS为可匿名访问和asp.net web.config中设置为form验证 2,检索数据存储验证用户,并检索角色(如果不是基于角色可不用) 3,使用FormsAuthenticationTicket创建一个Cookie并回发到客户端,并存储 角色到票据中,如: FormsAuthentication.SetAuthCookie(Username,true | false) cookies保存时间: HttpContext.Current.Response.Cookies[FormsAuthentication.FormsCookieName]. 阅读全文
posted @ 2011-06-14 12:50 Code & Life 阅读(1365) 评论(0) 推荐(1) 编辑
摘要: View Code 1usingSystem;2usingSystem.Collections.Generic;3usingSystem.Linq;4usingSystem.Text;5usingSystem.Web.Security;6usingSystem.Web;7usingSystem.Configuration;8usingSecom.EMS.Web.Common.Helper;9usingSecom.EMS.Web.Common.Models;1011namespaceSecom.EMS.Web.Common.Helper12{13publicclassUserHelper14{1 阅读全文
posted @ 2011-06-14 12:48 Code & Life 阅读(477) 评论(0) 推荐(0) 编辑