zoukankan      html  css  js  c++  java
  • save cookies and get cookies in system using asp.net

    1. use Response.cookies[“cookiesname”][“keyname”] to save cookies
    2. use  Request.cookies[“cookiesname”][“keyname”] to get cookies;

    Eg.
    Save cookies codingl
    Response.Cookies["userinfo"]["username"] = tb_username.Text;
    Response.Cookies["userinfo"]["planner"] = tb_planner.Text;
    Response.Cookies["userinfo"].Expires = System.DateTime.Today.AddDays(10);
    Get cookies coding
      assumption: there are two texbboxs username and planner. When user input the username, the planner will fill out the textbox automatically.
    string oldstr = Request.Cookies["userinfo"]["username"];
       if (tb_username.Text==oldstr)
          tb_planner.Text = Request.Cookies["userinfo"]["planner"];


     

  • 相关阅读:
    ajax优缺点
    关于测量专业软件使用感受及建议
    12.7
    12.6
    场景调研
    对搜狗输入法的看法及建议
    12.9
    12.8
    12.5站立会议
    12.4站立会议
  • 原文地址:https://www.cnblogs.com/Winston/p/1026470.html
Copyright © 2011-2022 走看看