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"];


     

  • 相关阅读:
    正则表达式
    匿名函数作业
    内置函数&匿名函数
    模拟面试题一
    迭代器
    生成器
    装饰器
    函数
    疑问?
    3,app信息抽取
  • 原文地址:https://www.cnblogs.com/Winston/p/1026470.html
Copyright © 2011-2022 走看看