复制代码 代码如下:
<%
' make sure you have the 6 dir_*.gif files!
' yes, you can copy ours if ya want too.. :)
' http://line9.com/img/dir_dir.gif .. etc.
function showimagefortype(strname)
strtemp = strname
if strtemp <> "dir" then
strtemp = lcase(right(strtemp, len(strtemp) - instrrev(strtemp, ".", -1, 1)))
end if
select case strtemp
case "dir"
strtemp = "dir"
case "asp"
strtemp = "asp"
case "htm", "html"
strtemp = "htm"
case "gif", "jpg", "jpeg", "png", "tif", "cpt", "bmp", "pcx", "tga", "psd", "eps"
strtemp = "img"
case "txt", "text", "dat", "bat", "sys"
strtemp = "txt"
case else
strtemp = "misc"
end select
strtemp = "<img src=""img/dir_"&strtemp&".gif"" width=16 height=16 border=0>"
showimagefortype = strtemp
end function
tek9 = request.querystring("tek9")
if tek9 = "" then strpath = "mydirectory/" else strpath = tek9
set objfso = server.createobject("scripting.filesystemobject")
set objfolder = objfso.getfolder(server.mappath(strpath))
response.write"<b>view our files and folders here:</b><br>"&_
"<table border=0><tr><td colspan=2>"&_
"<img src=""img/dir_dir_open.gif"" width=16 height=13 border=0> <font face=arial
size=2><b>"&strpath&"</b></font></td></tr>"
for each objitem in objfolder.subfolders
if instr(1, objitem, "_vti", 1) = 0 then
response.write"<tr><td><font face=arial size=2> "&showimagefortype("dir")&" "&_
"<a href=""myfile.asp?tek9="&strpath&objitem.name&"/"">"&_
""&objitem.name&"</a></font></td><td> </td></tr>"
end if
next
for each objitem in objfolder.files
response.write"<tr><td><font face=arial size=2>"&_
" "&showimagefortype(objitem.name)&" "&_
"<a href="""&strpath&objitem.name&""">"&objitem.name&"</a></font></td>"&_
"<td align=right><font face=arial size=2>"&objitem.size&"</font></td></tr>"
next
set objitem = nothing
set objfolder = nothing
set objfso = nothing
response.write"</table>"
%>
申明:本教程内容由威凡网编辑整理并提供IT程序员分享学习,如文中有侵权行为,请与站长联系(QQ:254677821)!