asp显示图片信息:
<%
Dim fso, f, f1, fc, s
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFolder(server.mapPath("../uploadfiles/")) ''uploadfiles为你的图片文件夹
Set fc = f.Files
For Each f1 in fc
response.write f1.name
response.write "<BR>"
Next
ShowFolderList = s
%>
asp显示图片并能删除:
<%
myFolder="../uploadfiles/"
'''''''删除删除文件。
if request("act")="del" then
Set fso = CreateObject("Scripting.FileSystemObject")
set f2 = fso.GetFile(server.mapPath(myFolder & request("fname")))
f2.Delete
response.redirect("2.asp") ‘2.asp的文件名为此程序段的文件名
end if
Dim fso, f, f1, fc, s
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFolder(server.mapPath(myFolder)) ''uploadfiles为你的图片文件夹
Set fc = f.Files
For Each f1 in fc
response.write "<img src="""&myFolder&f1.name &""" height=100 alt='"&f1.name&"'><a href='?act=del&fname="&f1.name&"'>删除</a>"
response.write "<BR>"
Next
ShowFolderList = s
%>
<% Set fso = Server.CreateObject("Scripting.FileSystemObject") '建立FSO对象
Set fd = fso.GetFolder(server.mappath("works"))
tpath=server.mappath("./")
i=1
For each sfd In fd.SubFolders
For each f In sfd.Files
s=f.path
s=replace(s,tpath&"\","")
i=i+1
Next
Next
set fso=nothing%>