日期:2014-05-17  浏览次数:21144 次

请高人帮忙写个统计当前文件夹文件数量的代码
请高人帮忙写个统计当前文件夹文件数量的代码

除了FSO,不要其他组件.

在IIS测试成功后给分

------解决方案--------------------
晕,这也值100分??

Dim oFo,m_lngFileCount

Set oFo=Server.CreateObject( "Scripting.FilesystemObject ")
ScanFolder oFo.GetFolder(Server.Mappath(文件夹名))
set oFo=nothing
Response.write "文件数: " & m_lngFileCount

Sub ScanFolder(oFolder)
Dim oTmp
m_lngFileCount=m_lngFileCount+oFolder.files.count
For Each oTmp In oFolder.SubFolders
ScanFolder oTmp
Next
End Sub
------解决方案--------------------
楼上的都说了。
是来接分的。
------解决方案--------------------
www.dullwolf.cn

笨狼代码大管家,里面有你要的代码.
------解决方案--------------------
<%
dim n
n=0
Set fs=Server.CreateObject( "Scripting.FileSystemObject ")
foldername=server.mappath( "./ ")
Set myfolder=fs.GetFolder(foldername)
Response.Write "当前文件夹下的文件总数为: "
For Each Item In myfolder.Files
n=n+1
Next
response.write n
Set fs=nothing
%>

------解决方案--------------------
网上一堆一堆的,楼主...