我也碰到过个问题,不过我用的是这个方法,在首页里用frame一个页面,宽高都为1,即隐藏,假设这个页面是chk.asp,假设我希望这个程序段在8点,20点及24点执行,可以在chk.asp里写这样的代码
<%
dim startime,startmin,startsec
startime=hour(now())
startmin=minute(now())
startsec=second(now())
if IsEmpty(Application("chk"))=true then
application.lock
application("chk")=false
application.unlock
end if
if IsEmpty(Application("time"))=true then
application.lock
application("time")=2
application.unlock
end if
if (startime=8 or startime=20 or startime=0) and application("time")<>startime then
application.lock
application("chk")=false
chkdo
application.unlock
end if
if application("chk")=false then
chkdo
end if
//执行代码函数
function chkdo()
//要执行的代码内容
end function
%>
当时我是这样用的,测试还可以,效果正常,不知道还有没有更好的办法