明輝手游網(wǎng)中心:是一個(gè)免費(fèi)提供流行視頻軟件教程、在線學(xué)習(xí)分享的學(xué)習(xí)平臺(tái)!

ASP與ASP.NET在COOKIE方面的區(qū)別

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

//ASP.NET

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

//寫(xiě)
var cookie : HttpCookie = new HttpCookie("test");

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

//ASP

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

//寫(xiě)
Response.Cookies("test") = "abc";
       
//若COOKIE為ASP創(chuàng)建,則在.NET中需用下列方法解碼,否則會(huì)有亂碼問(wèn)題

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