日期:2014-05-17 浏览次数:20569 次
public partial class Result : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (Request.Cookies["MyCookie"]!=null) { Label1.Text = Request.Cookies["MyCookie"].Value; } else { Label1.Text = "No cookies"; } } protected void Button1_Click(object sender, EventArgs e) { if (Request.Cookies["MyCookie"]!=null) { Request.Cookies["MyCookie"].Expires = DateTime.Now.AddDays(-1); Response.Redirect("Result.aspx"); } } }