28,390
社区成员
发帖
与我相关
我的任务
分享
Function GetFolders(fldr)
Set objFS = Server.CreateObject("Scripting.FileSystemObject")
Set objFolder = objFS.GetFolder(server.MapPath(fldr))
dirstr=""
For Each folder In objFolder.SubFolders
str = folder.name'这里是文件夹名
'这里就读取上面文件名下面的文件名
Next
getfolders=dirstr
Set objFolder = nothing
Set objFS = nothing
End Function
web=trim(request.Form("selname2"))
if len(web)=0 then
Response.Write "<script>alert('请选中<option>的值');history.back();</script>"
response.end()
end if
Dim arr,paths,fso,objFolder,file,foldFiles
arr=split(web,"|")
Set fso=Server.CreateObject("Scripting.FileSystemObject")
for i=0 to ubound(arr)
webs=split(arr(i),",")
paths="images/" & webs(0) & "/" &webs(1) '图片文件所在的文件夹
Set objFolder = fso.GetFolder(Server.MapPath(paths))
Set foldFiles = objFolder.files
i=1
For Each file In foldFiles
images=split(file,"\")
files=images(ubound(images))
i=files
response.write "<td><a href='show.asp?images="&i&"'>"&files&"<br><br></td>"
next
Set objFolder=nothing
Set foldFiles=nothing
next
Set fso=nothing
'获取文件夹里所有文件的名称
'StrPath 文件夹的路径
Function FsoFolder(StrPath)
Set Fso=Server.CreateObject("Scripting.FileSystemObject")
FilePath=Server.MapPath(StrPath)
Set F=Fso.GetFolder(FilePath)
For Each objf in F.Files
content=content&objf.name
Next
FsoFolder=content
set Fso=nothing
set F=nothing
End If
<%
if request.form("selname2")<>"" then
web=request.Form("selname2")
webs=split(web,",")
else
Response.Write "<script>alert('请选中<option>的值')</script>"
end if
%>
<%
Dim paths,fso,objFolder,file,foldFiles
paths="images/" & webs(0) & "/" &webs(1) '图片文件所在的文件夹
Set fso=Server.CreateObject("Scripting.FileSystemObject")
Set objFolder = fso.GetFolder(Server.MapPath(paths))
Set foldFiles = objFolder.files
i=1
For Each file In foldFiles
images=split(file,"\")
files=images(ubound(images))
i=files
response.write "<td><a href='show.asp?images="&i&"'>"&files&"<br><br></td>"
Next
Set objFolder=nothing
Set objSubFolders=nothing
Set foldFiles=nothing
Set fso=nothing
%>