用foreach遍历cookies出现异常
用foreach遍历cookie出现异常
foreach (HttpCookie cookie in Request.Cookies)
{
Response.Write(cookie.Value);
}
提示无法将类型为“System.String”的对象强制转换为类型“System.Web.HttpCookie”。
用foreach遍历cookie出现异常
foreach (HttpCookie cookie in Request.Cookies)
{
Response.Write(cookie.Value);
}
提示无法将类型为“System.String”的对象强制转换为类型“System.Web.HttpCookie”。
不是作用的问题 是想理解里面的原理 为什么其他都能遍历
而碰到cookie就出问题呢?