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)
写入时:
HttpCookie cookie = new HttpCookie("cookie1");
cookie.Value = Server.UrlEncode(strValue);
Response.Cookies.Add(cookie);
读出时:
string result = Server.UrlDecode(Request.Cookies["cookie1"].Value)