asp.net webForm登陸受權

HttpCookie cookie;
cookie = FormsAuthentication.GetAuthCookie(W3Account, isRemberMe);
if (isRemberMe)
{
       cookie.Expires = System.DateTime.Now.AddDays(1);
}
HttpContext.Current.Response.Cookies.Add(cookie);
string targetUrl;
targetUrl = FormsAuthentication.GetRedirectUrl(W3Account, isRemberMe);
HttpContext.Current.Response.Redirect(targetUrl);
相關文章
相關標籤/搜索