复制代码 代码如下:
string[] cooName = new string[Request.Cookies.Count];
string[] cooValue = new string[Request.Cookies.Count];
HttpCookie aCookie;
for(int i=0;i<Request.Cookies.Count;i++){
aCookie = Request.Cookies[i];
cooName[i] = Server.HtmlEncode(aCookie.Name);
if(!aCookie.HasKeys){
cooValue[i] = Server.HtmlEncode(aCookie.Value);
}else{
string[] subcooName = new string[aCookie.Values.Count];
string[] subcooValue = new string[aCookie.Values.Count];
for(int j=0;j<aCookie.Values.Count;j++){
subcooName[j] = Server.HtmlEncode(aCookie.Values.AllKeys[j]);
subcooValue[j] = Server.HtmlEncode(aCookie.Values[j]);
}
}
}
复制代码 代码如下:
HttpCookie cookie;
cookie = Request.Cookies["userInfo"];
aCookie.Values.Remove("userName");
aCookie.Expires = DateTime.Now.AddDays(1);
Response.Cookies.Add(aCookie);
新闻热点
疑难解答
图片精选