ASP read the files in the directory

Source: Internet
Author: User
Tags readable

<%
Dim spath, oFSO, Ofout, File
spath = "plugin/"
Set oFSO = Server.CreateObject ("Scripting.FileSystemObject")
Set ofout = Ofso.getfolder (Server.MapPath (spath))
Response.Write "<table border= ' 1 ' cellspacing= ' 0 ' cellpadding= ' 0 ' align= ' center ' >" & _
"<tr align= ' center ' >" & _
"<td> file name </td>" & _
"<td> file short path name </td>" & _
"<td> File Physical Address </td>" & _
"<td> file Properties </td>" & _
"<td> File Size </td>" & _
"<td> file Type </td>" & _
"<td> File creation Time </td>" & _
"<td> Recent Access </td>" & _
"<td> Last Modified </td>" & _
"</tr>"
For each File in Ofout.files
Response.Write "<tr>" & _
"<td>" & File.name & "</td>" & _
"<td>" & File.shortpath & "</td>" & _
"<td>" & File.path & "</td>" & _
"<td> & File.attributes &" ("& Senfe_attributes (file.attributes) &") </td> "& _
"<td>" & File.size & "</td>" & _
"<td>" & File.type & "</td>" & _
"<td>" & file.datecreated & "</td>" & _
"<td>" & file.datelastaccessed & "</td>" & _
"<td>" & file.datelastmodified & "</td>" & _
"</tr>"
Next
Response.Write "</table>"
Set ofout = Nothing
Set oFSO = Nothing
Function senfe_attributes (Itype)
Select Case Itype
Case 0 senfe_attributes = "normal-normal file, no properties are set."
Case 1 senfe_attributes = "readonly-read-only file, readable and writable."
Case 2 senfe_attributes = "hidden-hidden file, readable and writable."
Case 4 Senfe_attributes = "system-system file, readable and writable."
Case senfe_attributes = "directory-folder or directory, read only."
Case senfe_attributes = "archive-The file that has changed since the last backup, read and write."
Case 1024 senfe_attributes = "alias-link or shortcut, read only."
Case 2048 senfe_attributes = "compressed-compressed file, read only."
End Select
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.