Asp > Code Snippets
This shows how to display the contents of a directory that the script is in
This shows how to display the contents of a directory that the script is in
Directory details
<% Dim strPath , strPhysical strPath = Request.ServerVariables("SCRIPT_NAME") strPhysical = Server.MapPath(strPath) Dim objFSO , objFile , objFileItem , objFolder , objFolderFiles ' create an instance of the FileSystemObject set objFSO = CreateObject("Scripting.FileSystemObject") ' get a file object that corresponds to the file that we have the path for set objFile = objFSO.GetFile(strPhysical) 'return a reference to a folder object that represents the folder the file resides in set objFolder = objFile.ParentFolder set objFolderFiles = objFolder.Files %>
File Name
File Size
Last modified
<% For Each objFileItem In objFolderFiles Response.Write "
" Response.Write objFileItem.Name Response.Write "
" Response.Write objFileItem.Size Response.Write "
" Response.Write objFileItem.DateLastModified Response.Write "
" Next %>
Asp Codes
ActiveX
ADO
Array
Code Snippets
Components
Data Access
Date Time
Files
Graphics
HTML Formatting
Mathematics
Miscellaneous
Sessions
SQL
Strings
Techniques
XML