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


 

相关文章:

  • 2021-09-28
  • 2021-10-01
  • 2022-12-23
  • 2021-12-18
  • 2021-10-18
  • 2021-12-06
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-02-12
  • 2021-12-24
  • 2021-08-01
  • 2022-12-23
  • 2021-12-23
  • 2022-02-26
  • 2022-12-23
相关资源
相似解决方案