c# .net在WEB页中的COOKIES设置技巧
一、设置cookies的方法很简单,有以下两种方法: 1、直接添加Cookie值: Response.Cookies[“userName”] = “Tom”; Response.Cookies[“userName”].Expires = DateTime.Now.AddDays(1) ; \\过期时间,在Cookies文件中无法查看,也不能调用. 2、创建Cookie对象的一个实例: HttpCookie cookie=new HttpCookie(“userName”); cookie.Value = “Tom”; cookie.Expires = DateTime.Now.AddDays(
下载地址
用户评论