C#中想要用HttpCookie需要添加什么引用。
publicstaticvoidWriteCookie(stringstrName,stringstrValue){HttpCookiecookie=HttpContex...
public static void WriteCookie(string strName, string strValue)
{
HttpCookie cookie = HttpContext.Current.Request.Cookies[strName];
if (cookie == null)
{
cookie = new HttpCookie(strName);
}
cookie.Value = strValue;
HttpContext.Current.Response.AppendCookie(cookie);
}
未能找到类型名或命名空间名称“ HttpCookie”,上下文中不存在 HttpContext 怎么办?谢谢 展开
{
HttpCookie cookie = HttpContext.Current.Request.Cookies[strName];
if (cookie == null)
{
cookie = new HttpCookie(strName);
}
cookie.Value = strValue;
HttpContext.Current.Response.AppendCookie(cookie);
}
未能找到类型名或命名空间名称“ HttpCookie”,上下文中不存在 HttpContext 怎么办?谢谢 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询