創建
復制代碼 代碼如下:
HttpCookie cookies = new HttpCookie("validate");
cookies["validate"] = validateNum;
Response.AppendCookie(cookies);
獲取
復制代碼 代碼如下:
if (context.Request.Cookies["validate"] != null)
{
validate = context.Request.Cookies["validate"].Value.ToString();
}
測試可用!