清风的blog 优然探索

FormsAuthentication

   FormsAuthentication.SetAuthCookie(sUserID, false);
                FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(
                1,
                sUserID,
                DateTime.Now,
                DateTime.Now.AddMinutes(30),
                false,
                sUserInfo,
                FormsAuthentication.FormsCookiePath);
                string hash = FormsAuthentication.Encrypt(ticket);
                HttpCookie cookie = new HttpCookie(FormsAuthentication.FormsCookieName, hash);
                Response.Cookies.Add(cookie);

2009年1月15日 | 发布:admin | 分类:技术文章 | 评论:0

发表留言: