Sign-up....

一个小问题,请高手回答?

<%

response.buffer = true

dim count

count = request.cookies("vcount")

if count > "0" then

count = count + 1

response.write("欢迎您" & count & "访问本站")

else

count = 1

response.write("欢迎您首次访问本站!")

end if

response.cookies("vcount") = count

response.flush

%>

这里的count > "0",0为什么要加引号?不加IE会报错!

[288 byte] By [msdn] at [2007-8-15 10:04:23]
# 1 Re: 一个小问题,请高手回答?

count = request.cookies("vcount")

因为count是在这里赋值的,而 request.cookies("vcount") 是个字符串值,所以是 "0"

可以这样:

count = cint(request.cookies("vcount"))

这样的话,就是count=0了

dxef at 2006-6-9 14:45:57 >
# 2 Re: 一个小问题,请高手回答?

):jf

liangjianshi at 2006-6-9 14:48:48 >
# 3 Re: 一个小问题,请高手回答?

count 是字符型的,不是数字型的,所以要加“”

jjt009 at 2006-6-9 15:01:16 >

Web

All Classified