请看这段代码:
xxx = request.Cookies("atop")("xxxxxxx")
If isnumeric(xxx) =True then
response.write "8888888"
Else
response.write "XXXXXXXX"
End If
在没有Cookies的情况下,isnumeric 竟然会把xxx识别为数字,从而输出 “88888”。这个问题害我好多次出现莫名其妙的错误。现在我的解决方式是加个TRIM函数:xxx =trim( request.Cookies("atop")("xxxxxxx") ) ,输出就正常了,很奇怪吧。
为了双保险,可以把判断再修改为:If isnumeric(xxx) =True and xxx<>"" then
不管怎么说,这是个莫名其妙的错误。小心小心再小心,否则永远不知道自己是怎么死的。