asp下用fso生成js文件的代码
2018-09-06 12:47
阅读:410
<%subfsojs()%>
<%
Setfso=Server.CreateObject(Scripting.FileSystemObject)
setfd=fso.createtextfile(server.MapPath(../category.js),true)
开始操作
setrs=server.CreateObject(adodb.recordset)
rs.Openselect*fromdept_category,conn,1,1
str=varonecount;&vbcrlf&onecount=0;&vbcrlf&subcat=newArray();
fori=1tors.recordcount
str=str&vbcrlf&subcat[&(i-1)&]=newArray(&rs(category)&,&rs(parentid)&,&rs(categoryid)&);
rs.movenext
Next
str=str&vbcrlf&onecount=&rs.recordcount&;&vbcrlf
fd.writelinestr
%>
<%endsub%>
评论
亲,登录后才可以留言!