当前位置: 网学 > 编程文档 > ASP > 正文

LINE9的目录浏览源程序

来源:Http://myeducs.cn 联系QQ:点击这里给我发消息 作者: 用户投稿 来源: 网络 发布时间: 13/06/17

鉴于大家对asp十分关注,我们编辑小组在此为大家搜集整理了“LINE9的目录浏览源程序”一文,供大家参考学习

复制代码 代码如下:
<%
'' make sure you have the 6 dir_*.gif files!
'' yes, you can copy ours if ya want too.. :)
'' /uploadfile/201306/17/8A15395576.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=""/uploadfile/201306/17/8B153917627.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>"
%>

  • 上一篇资讯: asp最常用的分页函数
  • 下一篇资讯: asp:生成静态页面函数
  • 网学推荐

    免费论文

    原创论文

    浏览:
    设为首页 | 加入收藏 | 论文首页 | 论文专题 | 设计下载 | 网学软件 | 论文模板 | 论文资源 | 程序设计 | 关于网学 | 站内搜索 | 网学留言 | 友情链接 | 资料中心
    版权所有 QQ:3710167 邮箱:3710167@qq.com 网学网 [Myeducs.cn] 您电脑的分辨率是 像素
    Copyright 2008-2015 myeducs.Cn www.myeducs.Cn All Rights Reserved
    湘ICP备09003080号