安全验证

 

安全验证 代码
   
     
// Todo
// FormsAuthentication.RedirectFromLoginPage(UserName.Text, RememberMe.Checked);

string userDatastring = Companies[i] + " | " + TitleatCompany[i];
HttpCookie authCookie
= FormsAuthentication.GetAuthCookie(UserName.Text, RememberMe.Checked);
FormsAuthenticationTicket ticket
= FormsAuthentication.Decrypt(authCookie.Value);
FormsAuthenticationTicket newTicket
= new FormsAuthenticationTicket(ticket.Version, ticket.Name, ticket.IssueDate, ticket.Expiration, ticket.IsPersistent, userDatastring);
authCookie.Value
= FormsAuthentication.Encrypt(newTicket);
Response.Cookies.Add(authCookie);
string Url = FormsAuthentication.GetRedirectUrl(UserName.Text, RememberMe.Checked);
Response.Redirect(Url);

 

 

 

web.config

安全验证 Code

你可能感兴趣的:(安全)