asp编程-急,在线等

来源:百度知道 编辑:UC知道 时间:2024/06/05 14:02:40
我编了一段asp程序
<%dim fso,f1,s1,s2,s3
whichfile=server.MapPath("test1")
set fso=Server.CreateObject("scripting.filesystemobject")
f1=fso.getfolder(whichfile)
response.Write(f1)
s1=f1.size(whichfile)
response.Write("s1")
s2=f1.file(whichfile)
response.Write("s2")
%>
目的是想在同级文件夹里寻找一个叫“test1”的文件夹
并返回它的大小,列出它里面包含的所有文件
但是运行的时候提示缺少对象,这是为什么啊
请高手指教,谢谢了,急,在线等

<%dim fso,f1,content
whichfile=server.MapPath("test1")
set fso=Server.CreateObject("scripting.filesystemobject")
set f1=fso.getfolder(whichfile)
For Each objf in f1.Files
content=content&objf.name&Round(( objf.size /1024),2)&" KB"
next
response.write content
set fso=nothing
set f=nothing
%>