复制代码 代码如下:<!--#include file="conn.asp"-->
<%
set js = server.CreateObject("ADODB.RecordSet")
sql="select top 10 * from article order by id desc"
set js = conn.Execute (Sql)
do while not js.eof
title=js("title")
addate=js("addate")
foolcat = foolcat + "<li><a href=""/"& js("id")&".htm"">" &title&" "&addate&"</a></li><br>"
js.movenext
loop
'生成JS文件
foolcat = "" + foolcat + ""
foolcat = "document.write('" & foolcat & "')"
FolderPath = Server.MapPath("./")
Set fso = Server.CreateObject("Scripting.FileSystemObject")
Set fout = fso.CreateTextFile(FolderPath&"\top10.js")
fout.WriteLine foolcat
'关闭连接
fout.close
set fout = nothing
js.close
set js = nothing
conn.close
set conn=nothing
%>
标签:
用ASP+FSO生成JS文件
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件!
如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
桃源资源网 Design By www.nqtax.com
暂无“用ASP+FSO生成JS文件”评论...