我试着把我的曲奇设置到我的网站上,但是当我在代码中写Http cookie时,
我的代码如下所示:
HttpCookie StudentCookies = new HttpCookie("StudentCookies");
StudentCookies.Value = 1;
Response.Cookies.Add(StudentCookies);错误是:
无法找到类型或命名空间名称'HttpCookie‘(您是缺少使用指令还是程序集引用?)TestMVCLagerSystem.DNX 4.5.1 “‘Response”不包含“Cookies”TestMVCLagerSystem.DNX 4.5.1的定义
我试着在这里看:
发布于 2015-10-28 22:17:08
试着用这个代替:
HttpContext.Current.Response.Cookies.Add(StudentCookies);HttpCookie和HttpContext都属于System.Web引用(使用System.Web;)
(编辑以显示代码格式)
https://stackoverflow.com/questions/33397364
复制相似问题