我做了一个asp小程序,在不同的时间段页面上能提示不同的话,但是我就是实现不了,高手帮我改改~~谢谢了

来源:百度知道 编辑:UC知道 时间:2024/05/13 05:19:07
我做了一个asp小程序,在不同的时间段页面上能提示不同的话,但是我就是实现不了,高手帮我改改~~谢谢了

<% Dim a
a=time()

if a>="#00-00-00#"and a<"#9-00-00#" then
response.Write("早上好^^")
else
if a>="#10-00-00#"and a<"#12-00-00#" then
response.Write("该吃中午饭了~!")
else
if a>="#12-00-00#"and a<"#14-00-00#" then
response.Write("睡个午觉吧~~~~~~")
else
if a>="#14-00-00#"and a<"#17-00-00#" then
response.Write("下午好^^")
else
if a>="#17-00-00#"and a<"#20-00-00#" then
response.Write("该吃晚饭了!!")
else
response.Write("晚安,做个好梦啊~~~")
End if
End if
End if
End if
End if
请帮我找找我的错误,能不能帮我指出错误在哪啊~~~要不下次我还是不会,hotyxm说的a=time()好像是可以的~大家说呢?

大哥
把偶晕惨了,小错误 哈
把AND改成OR就OK了
偶来改改哈
Dim a
a=time()

if a>="#00-00-00#" or a<"#9-00-00#" then
response.Write("早上好^^")
else
if a>="#10-00-00#" or a<"#12-00-00#" then
response.Write("该吃中午饭了~!")
else
if a>="#12-00-00#" or a<"#14-00-00#" then
response.Write("睡个午觉吧~~~~~~")
else
if a>="#14-00-00#" or a<"#17-00-00#" then
response.Write("下午好^^")
else
if a>="#17-00-00#" or a<"#20-00-00#" then
response.Write("该吃晚饭了!!")
else
response.Write("晚安,做个好梦啊~~~")
End if
End if
End if
End if
End if
把IF和ELSE迦在一起就更好了
我改一下
Dim a
a=time()

if a>="#00-00-00#" or a<"#9-00-00#" then
response.Write("早上好^^&