VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Lists all file within the current directory.

by Matt Massey (4 Submissions)
Category: Active Server Pages
Compatability: ASP (Active Server Pages)
Difficulty: Unknown Difficulty
Originally Published: Sun 31st January 1999
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Lists all file within the current directory.

Rate Lists all file within the current directory.



<head><title></title></head>
<body>
<%
  Dim fso, f, f1, fc, s
  Set fso = CreateObject("Scripting.FileSystemObject")
TheFile = Server.MapPath(Request.ServerVariables("SCRIPT_NAME"))
loc = InStrRev(TheFile,"\")
TheFile = Left(TheFile,loc)
  Set f = fso.GetFolder(TheFile)
  Set fc = f.Files
  For Each f1 in fc
    'change the file extensions to view different files.
if right(f1,5) = ".html" or right(f1,4) = ".htm" then 
            s = s & "<A HREF='" & f1.name & "'>" & f1.name & "</A>"
s = s &  "<BR>"
End If
  Next
  ShowFileList = s

%>
<% 
response.write ShowFileList
%>
</body>
</html>

Download this snippet    Add to My Saved Code

Lists all file within the current directory. Comments

No comments have been posted about Lists all file within the current directory.. Why not be the first to post a comment about Lists all file within the current directory..

Post your comment

Subject:
Message:
0/1000 characters