asp.net下cookies的丢失和中文乱码

//写入cookies时
string t =HttpUtility.UrlEncode(要写入到cookies的中文值);
HttpCookie c = new HttpCookie("user_realname", t);
Response.Cookies.Add(c);
//读取cookies时
t=获取的中文cookies值;
t = HttpUtility.UrlDecode(teacher_name);

你可能感兴趣的:(C++,c,.net,asp.net,asp)