在WEB頁中設置COOKIES
一
Response
Response
HttpCookie cookie=new HttpCookie(
cookie
cookie
Response
用以上任一方法都可以生成一個有
也可以創建和添加有子鍵的Cookies
Response
或
HttpCookie cookie=new HttpCookie(
cookie
aCookie
Response
二
Cookies某一鍵的值為
Server
你可以用Response
Response
或賦值給其它變量
string strCookie
用Cookies[i]數組可以檢索所有項和子鍵
string[] cooName = new string[Request
string[] cooValue = new string[Request
HttpCookie aCookie;
for(int i=
aCookie = Request
cooName[i] = Server
if(!aCookie
cooValue[i] = Server
}else{
string[] subcooName = new string[aCookie
string[] subcooValue = new string[aCookie
for(int j=
subcooName[j] = Server
subcooValue[j] = Server
}
}
}
三
如果是數值類型的Cookie值
四
刪除Cookies只要把有效期設為失效就可以了
cookie
要刪除則設為
cookie
刪除子鍵
HttpCookie cookie;
cookie = Request
aCookie
aCookie
Response
From:http://tw.wingwit.com/Article/program/net/201311/12802.html