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


     

  • 相关阅读:
    HTTPS原理浅析
    Java8 HashMap源码分析
    Java8 ArrayList源码分析
    Java反射
    Java泛型
    Tensorflow卷积神经网络
    Java8 Stream简介
    java.io与网络通信
    Python实现RNN
    域名系统DNS简介
  • 原文地址:https://www.cnblogs.com/Winston/p/1026470.html
Copyright © 2011-2022 走看看