读存cookie

 //存
HttpCookie cookie = new HttpCookie("test");
        cookie.Name = "ss";
        cookie.Value = "sss";
        cookie.Values.Add("s1", "ss1");
        cookie.Values.Add("s2", "ss2");
        cookie.Expires = DateTime.Now.AddDays(2);
        Response.Cookies.Add(cookie);
//读
        HttpCookie getCookie = Request.Cookies["ss"];
 string singleValue = getCookie.Value;
 string multiValue1 = getCookie.Values["s1"]

你可能感兴趣的:(C#,asp.net)