Response.Cookies(“VisitCount”).Expires = DateAdd(“m”,3,Now) 假如想要更新Visits和LastDate的值,必须先不需改变的所有值,然后重写整个的cookie:
datDtart = Response.Cookies(“VisitCount”)(“StartDate”) intVisits = Response.Cookies(“VisitCount”)(“Visits”) Response.Cookies(“VisitCount”)(“StartDate”) = dtmStart Response.Cookies(“VisitCount”)(“LastDate”) = Now Response.Cookies(“VisitCount”)(“Visits”) = Cstr(intVisits) Response.Cookies(“VisitCount”).Path = “/” Response.Cookies(“VisitCount”).Expires = DateADD(“m”,3,Now + 1)且对于几乎所有的其他Response方法和属性,应该在写入任何内容(即打开<HTML>标记或任何文本或其他的HTML)到响应之前完成这个工作。 |