明辉手游网中心:是一个免费提供流行视频软件教程、在线学习分享的学习平台!

ASP与ASP.NET在COOKIE方面的区别

[摘要]//ASP.NET//读Request.Cookies("test").value;//写var cookie : HttpCookie = new HttpCookie("test");cookie .value = "abc";Re...

//ASP.NET

//读
Request.Cookies("test").value;

//写
var cookie : HttpCookie = new HttpCookie("test");

cookie .value =  "abc";
Response.Cookies.Add(cookie );    

//ASP

//读
Request.Cookies("test");

//写
Response.Cookies("test") = "abc";
       
//若COOKIE为ASP创建,则在.NET中需用下列方法解码,否则会有乱码问题

System.Web.HttpUtility.UrlDecode(c, System.Text.Encoding.Default);