View Source
Go Back to /jang/books/asp/example/fileAccess/fileProp01.asp
<%@language=JScript%>
<%  title="¦C¥XÀɮתºÄÝ©Ê" %>
<!--#include file="../head.inc"-->
<hr>

<%
// Reference: http://www.ezineasp.net/post/Javascript-FSO-GetFile-Method.aspx
fso = Server.CreateObject("Scripting.FileSystemObject");
fullPath = Request.ServerVariables("PATH_TRANSLATED");
file = fso.GetFile(fullPath);
methods = [
      "Attributes",
      "DateCreated",
      "DateLastAccessed",
      "DateLastModified",
      "Drive",
      "Name",
      "ParentFolder",
      "Path",
      "ShortName",
      "ShortPath",
      "Size",
      "Type"];
%>

<h3 align=center>file = <%=file%></h3>
<table border=1 align=center>
<%  for (i=0; i<methods.length; i++){
      cmd = "file." + methods[i]; %>

      <tr><td><%=cmd%><td> <font color=green><%=eval(cmd)%></font>
<%}%>
</table>

<hr>
<!--#include file="../foot.inc"-->