zoukankan      html  css  js  c++  java
  • 安全验证

    代码
    //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
  • 相关阅读:
    jvm05
    jvm04
    jvm03
    jvm02
    jvm01
    rabbitmq-01
    lock接口认识及可重入锁的实现
    volitile的使用
    自旋锁,死锁与重入锁
    上机实验4--求序列的最大元素和最小元素
  • 原文地址:https://www.cnblogs.com/shineqiujuan/p/1351043.html
Copyright © 2011-2022 走看看