Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想记录单个 cookie 以维护产品和所有产品的数量。我如何在 c# 中做到这一点。
当我可以检查 cookie 中产品的存在时,他们有什么方法可以做到这一点。有人有它的代码吗?
谢谢
创建一个cookie:
HttpCookie cookie = new HttpCookie("name", "value"); Request.Cookies.Add(cookie);
获取 cookie 值:
string cookie value = Response.Cookies["name"].Value;