帮我看一个ASP代码错误,为什么无法显示

来源:百度知道 编辑:UC知道 时间:2024/05/05 20:03:48
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>

<body>
<%
mytime=now //获取系统时间
myhour=hour(mytime) //获取当前小时数
Response.Write("当前时间为:"& mytime &"<br>" //输出当前时间
//根据当前小时数,输出不同问候语
if myhour<6 or myhour>=22 then Response.Write"你该休息了"
if myhour>=6 and myhour<8 then Resp

Response.Write("当前时间为:"& mytime &"<br>" //输出当前时间

这里少了个括号..或者说多了个括号

而且ASP的注释是 ' 单引号, 不是双斜杠 //

改成

Response.Write("当前时间为:"& mytime &"<br>") '输出当前时间

或者

Response.Write "当前时间为:"& mytime &"<br>" '输出当前时间

<%
mytime=now '//获取系统时间
myhour=hour(mytime) '//获取当前小时数
Response.Write("当前时间为:"& mytime &"<br>") '//输出当前时间
'//根据当前小时数,输出不同问候语
if myhour<6 or myhour>=22 then Response.Write"你该休息了"
if myhour>=6 and myhour<8 then Response.Write"早上好"
if myhour>=8 and myhour<12 then Response.Write"上午好"
if myhour>=12 and myhour<=14 then Response.Write"中午好"
if myhour>=14 and myhour<=18 then Response.Write"下午好"
if myhour>=18 and myhour<=22 then Response.Write"晚上好