28,391
社区成员
发帖
与我相关
我的任务
分享
function ShowFolder(FolderPath)
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFolder(Server.MapPath(FolderPath))
Set sf = f.SubFolders
for each ff in sf
'遍历下级子目录
ShowFolder(ff.name)
'显示图片
ShowPic(FolderPath & "/" & ff.name)
Next
End Function
function ShowPic(FolderPath)
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFolder(Server.MapPath(FolderPath))
set files = f.files
for each file in files
if(instr(file.name,".jpg") or instr(file.name,".gif"))Then
'如果是图片,就显示
response.write "<img src=""" & FolderPath & "/" & file.name & ""/>"
end if
next
end function