[导入]巧妙的让web来执行“计划任务”(转 biyuan老矣 )

updateIndex.asp:

<scrīpt language="Jscrīpt" runat="server">
var
fso = new ActiveXObject("scrīpting.FileSystemObject"
);
var
fts = fso.GetFile(Server.MapPath("index.shtml"
));

var
s = new Date(fts.DateLastModified).getDate
();
fso = null
;
var
t = new Date().getDate
();

if(
s == t
){
    
Response.Write("var typeString = '你找到这里来干嘛?';"
);
    
Response.End
();
}
else{
    
//省略生成index.shtml的代码
    
Response.Write("setTimeout(\"parent.location.reload();\",5000);"
);
    
Response.End
();
}
</scrīpt>

在index.shtml页面引用方式:

<scrīpt language="Javascrīpt" src="updateIndex.asp"></scrīpt>



suiqirui 2007-05-15 23:26 发表评论

文章来源:http://www.cnblogs.com/suiqirui19872005/archive/2007/05/15/747803.html

posted on 2007-06-17 11:50  温温恭人  阅读(154)  评论(0编辑  收藏  举报

导航