asp.net 中对cookie的中文编码操作

写入时:
HttpCookie cookie = new HttpCookie("cookie1");
cookie.Value = Server.UrlEncode(strValue);
Response.Cookies.Add(cookie);

读出时:
string result = Server.UrlDecode(Request.Cookies["cookie1"].Value)

posted on 2006-09-25 17:00  林晓可  阅读(939)  评论(1)    收藏  举报

导航