ASP displays all subdirectories under this directory when the directory exists

Source: Internet
Author: User
Tags chr

' Parameter: Directory name (relative path), object
Public Function showfolderlist (folderurl,tag,listtype)
Dim F,F1,FC,I,TEMP,DISABLEDTF
On Error Resume Next
temp = Server.MapPath (FolderUrl)
If ofso.folderexists (temp) Then
Set f = ofso.getfolder (temp)
Set FC = F.subfolders
If listtype = "List" Then
DISABLEDTF = "Disabled"
Else
DISABLEDTF = ""
End If
Showfolderlist = "<table width=" "100%" "border=" "0" "cellspacing=" "1" "cellpadding=" "1" ">" & Chr (13)
Showfolderlist = showfolderlist & "<tr class=" "defaulttitletd" ">" & Chr (13)
Showfolderlist = showfolderlist & "<td width=" "3%" "><input type=" "checkbox" "Name=" "Chkall" "id=" "Chkall" "Value=" "" title= "" Select All "onclick=" JavaScript Tutorials: Selectallcheckbox (' path ', this.id); checkdisabled (' button ', Getvaluelist (' input ')); " "& DISABLEDTF &"/></td> "& Chr (13)
Showfolderlist = showfolderlist & "<td> directory name/filename </td>" & CHR (13)
Showfolderlist = showfolderlist & "<td width=" "20%" "align=" "right" "> Size </td>" & CHR (13)
Showfolderlist = showfolderlist & "</tr>" & Chr (13)
i = 0
For each F1 in FC
Showfolderlist = showfolderlist & "<tr" & Lib.defaulttrstyle (i, "defaulttr", "Defaultmod", "Defaulttdover") & ">" & Chr (13)
Showfolderlist = showfolderlist & "<td><input name=" "Path" "id=" "Path" "Type=" "checkbox" "Value=" "" & FolderUrl & "/" & F1.name & "" onclick= "" javascript:checkdisabled (' button ', getvaluelist (' input ')); "" "& DISABLEDTF &"/></td> "& Chr (13)
Showfolderlist = showfolderlist & "<td><span style=" "Cursor:pointer" "onmouseover=" javascript: Xmlhttppost ('.. /inc/xmlhttp.asp ', ' action=preview&showtype=folder&filepath= ' & FolderUrl & '/' & F1.name & ', 0,0, ' preview ') "" onclick= "" javascript:location.href= "tag=" & Tag & "&listtype=" & ListType & " &folderurl= ' + Escape (' & FolderUrl & '/& F1.name & ') ' "> "& F1.name & "</span></td>" & Chr (13)
Showfolderlist = showfolderlist & "<td align=" "Right" ">" & Getfolderinfo (FolderUrl & "/" & F1.name) (0) & "</td>" & Chr (13)
Showfolderlist = showfolderlist & "</tr>" & Chr (13)
i = i + 1
Next
Showfolderlist = showfolderlist & "</table>" & Chr (13)
Else
Showfolderlist = "-"
End If
If Err <> 0 Then Err.Clear
Set F = Nothing
Set FC = Nothing
End Function

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.