根据时间动态显示问候的asp代码!

来源:百度知道 编辑:UC知道 时间:2024/06/11 07:47:18
<html>
<head>
<title>eg1</title>
</head>

<body>
<%
if Time<#12:00:00# and Time>=#00:00:00# then
str="早上好"
Elseif Time<#19:00:00# And Time>=#12:00:00# then
str="下午好"
else
str="晚上好"
end if
%>
<% =str %>

</body>
</html>
整个代码就是这样,但是我看不懂这句:if Time<#12:00:00# and Time>=#00:00:00# then 和这句:Elseif Time<#19:00:00# And Time>=#12:00:00# then
请问是什么意思?

<%
if time()<#12:00:00# and time()<=#00:00:00# then
response.Write("早上好")
Else if time()<#19:00:00# And time()>=#12:00:00# then
response.Write("下午好")
else
response.Write("晚上好")
end if
end if
%>
以上是正确的写法
time()现在你系统的时间
然后if<条件> then
执行 A
esle
执行 B
end if
大致意思是,如果条件成立就执行A,如果不成立就执行B
就是判断你现在的时间,属于什么时候,然后输出显示。