在Asp.net 中Cookie的用法

    protected void Page_Load(object sender, EventArgs e)
    {
        HttpCookie cookie = new HttpCookie("aspcn");//声明
        Response.AppendCookie(cookie);
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        Response.Cookies["aspcn"].Value = "bbnnnndddddn";//赋值

    }
    protected void Button2_Click(object sender, EventArgs e)
    {

        this.TextBox2.Text = Request.Cookies["aspcn"].Value;//取值
    }

相关文章:

  • 2021-06-03
  • 2021-10-06
  • 2021-06-28
  • 2022-12-23
  • 2021-06-13
  • 2021-06-21
  • 2021-12-31
猜你喜欢
  • 2021-10-29
  • 2022-02-09
  • 2021-10-14
  • 2022-12-23
  • 2022-12-23
  • 2021-10-24
相关资源
相似解决方案