ASP生成JS文件

| |
[不指定 2006/05/28 18:47 | by Else ]
用ASP+FSO生成JS文件
<!--#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")
goaler = goaler + "<li><a href=""/"& js("id")&".htm"">" &title&" "&addate&"</a></li><br>"
js.movenext
loop
'生成JS文件
goaler = "" + goaler + ""
goaler = "document.write('" & goaler & "')"
FolderPath = Server.MapPath("./")
Set fso = Server.CreateObject("Scripting.FileSystemObject")
Set fout = fso.CreateTextFile(FolderPath&"\top10.js")
fout.WriteLine goaler
'关闭连接
fout.close
set fout = nothing
js.close
set js = nothing
conn.close
set conn=nothing
%>

作者:Else 's Blog
地址:http://www.aixq.com/post/222/
版权所有。转载时必须链接形式注明作者和原始出处及本声明!
  • 中查看更多“ASP生成JS文件”相关内容
  • 中查看更多“ASP生成JS文件”相关内容
  • 中查看更多“ASP生成JS文件”相关内容
  • 中查看更多“ASP生成JS文件”相关内容
  • 中查看更多“ASP生成JS文件”相关内容
  • 中查看更多“ASP生成JS文件”相关内容
  • Tags:
    代码 程序 编程 | 评论(1) | 引用(0) | 阅读(2353)
    发表评论
    表情
    emotemotemotemotemot
    emotemotemotemotemot
    emotemotemotemotemot
    emotemotemotemotemot
    emotemotemotemotemot
    打开HTML
    打开UBB
    打开表情
    隐藏
    昵称   密码   游客无需密码
    网址   电邮   [注册]