asp cookie判断数字
发布网友
发布时间:2024-10-12 21:10
我来回答
共2个回答
热心网友
时间:2024-10-14 17:18
<%
dim a
a=request.cookies("click")
if IsNumeric(a) then
a=a+1
response.cookies("click")=a
'response.cookies("click").Expires=DateAdd("y",20,Now())
'设置为未来20年,也算是永久了
'response.cookies("click").Expires=DateAdd("d",1,Now())
'过期时间为一天
response.cookies("click").Expires=DateAdd("h",1,Now())
'过期时间为一小时
response.write(a)
else
response.cookies("click")=0
response.write("0")
end if
%>
热心网友
时间:2024-10-14 17:18
sub CookiesAdd(cname)
dim cook
cook = request.Cookies(cname)
if cook="" then
cook = 1
else
cook = cint(cook)+1
end if
response.Cookies(cname) = cook
end sub
Call CookiesAdd("click")
response.Write("当前Cookies是 " & request.Cookies("click"))