Dim where365 As HttpCookie= New HttpCookie("where365") where365.Value = "123" Response.Cookies.Add(where365) 可是用Response.Cookies("where365").Value依然取不到值
修改了一下 存 Dim city As HttpCookie city = New HttpCookie("city") city.Value = "上海" Response.Cookies.Add(city) 取 Dim pp As HttpCookie Dim c As String = "" pp = Request.Cookies("city") If Not pp Is Nothing Then c = Request.Cookies("city").Value End If这样还是取不到值,郁闷啊
首先 HttpCookie cookie=new HttpCookie();
cookie.Name="XXX";
cookie.Value="xxx";
Response.Cookies.Add(cookie);
cookie是用来写到客户端机器上去的...
貌似没有你这种用法
取cookie用Request.Cookies["name"].Value;..
楼主可能理解cookie错误???
HttpCookie pageindex = new HttpCookie("PageIndex");
pageindex.Value = "0";
Response.Cookies.Add(pageindex);
取值用:
Response.Cookies["PageIndex"].Value
where365.Value = "123"
Response.Cookies.Add(where365)
可是用Response.Cookies("where365").Value依然取不到值
username=Request.Cookies("username").value 读取
存 Dim city As HttpCookie
city = New HttpCookie("city")
city.Value = "上海"
Response.Cookies.Add(city)
取 Dim pp As HttpCookie
Dim c As String = ""
pp = Request.Cookies("city")
If Not pp Is Nothing Then
c = Request.Cookies("city").Value
End If这样还是取不到值,郁闷啊