zoukankan      html  css  js  c++  java
  • user login logout

     protected void LoginButton_Click(object sender, EventArgs e)
        {
            username 
    = Guid.NewGuid().ToString();
            Response.Write(username);
            FormsAuthenticationTicket ticket 
    = new FormsAuthenticationTicket(username, true20);
            
    string cookiestr = FormsAuthentication.Encrypt(ticket);
            HttpCookie ck 
    = new HttpCookie(FormsAuthentication.FormsCookieName, cookiestr);
            
    if (true)
            {
                ck.Path 
    = FormsAuthentication.FormsCookiePath;
            }
            Response.Cookies.Add(ck);
            FormsAuthentication.RedirectFromLoginPage(username, 
    false);
        }
        
    protected void LogoutButton_Click(object sender, EventArgs e)
        {
            FormsAuthentication.SignOut();
            Response.Redirect(
    "Default.aspx");
        }
  • 相关阅读:
    html5 to jsp
    java通过springMail发送邮件
    solr配置-Solrconfig.xml
    solr配置-Schema.xml
    solr连接数据库导入数据
    log4j 1.2 配置总结
    1-12 ARP协议
    1-11 ICMP协议
    1-10 网际层
    1-9 TCP/IP参考模型
  • 原文地址:https://www.cnblogs.com/sskset/p/1289723.html
Copyright © 2011-2022 走看看