ASP與ASP.NET在COOKIE方面的區別
發表時間:2024-06-02 來源:明輝站整理相關軟件相關文章人氣:
[摘要]//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);