VBScript Sample: vbscript/general/fileio/info.asp
   ASP Script
   Comments or Client-side Script
   HTML and Text

<html>
<head>
<title>File Info Example</title>
</head>
<SCRIPT Language="JavaScript">
function Ok_OnClick(form){
   form.submit();
}
</SCRIPT>

<body>
<%
   dim fs
   dim fi
   dim dir1
   dim filename1
   dim content
   dim attributes
   dim datecreated
   dim datelastaccessed
   dim datelastmodified
   dim drive
   dim name
   dim parentfolder
   dim path
   dim shortname
   dim shortpath
   dim size
   dim type1
   dim newline
   newline =chr(13)
   content= "File properties are: " +newline
   content =content +"Attributes : " +cstr(Attributes) +newline
   content =content +"DateCreated : " +datecreated +newline
   content =content +"DateLastAccessed : " +DateLastAccessed +newline
   content =content +"DatelastModified : " +DatelastModified +newline
   content =content +"Drive : " +Drive +newline
   content =content +"Name : " +Name +newline
   content =content +"ParentFolder : " +ParentFolder +newline
   content =content +"Path : " +Path +newline
   content =content +"ShortName : " +ShortName +newline
   content =content +"ShortPath : " +ShortPath +newline
   content =content +"Size : " +cstr(Size) +newline
   content =content +"Type : " +cstr(Type1) +newline
   
   set fs =server.CreateObject("Scripting.FileSystemObject")

   tempvar = cstr(fs.GetFile(server.mappath("default.html")).parentfolder )
   if instr("/",tempvar)<>0 then
      dir1 =tempvar +"/"
   else
      dir1 =tempvar +"\"
   end if
   filename1="test.txt"
   if not isempty(request.form("dir")) then
      dir1 =request.form("dir")
   end if

   if not isempty(request.form("filename")) then
      filename1 =request.form("filename")
      set fi =fs.GetFile(trim(dir1) & trim(filename1))
      Attributes = fi.Attributes
      datecreated =fi.Datecreated
      DateLastAccessed = fi.DateLastAccessed
      datelastmodified =fi.datelastmodified
      drive =fi.drive
      name= fi.name
      parentfolder=fi.parentfolder
      path =fi.path
      shortname=fi.shortname
      shortpath=fi.shortpath
      size=fi.size
      type1=fi.type
      content= "FILE PROPERTIES ARE : " +newline
      content =content +"Attributes : " +cstr(Attributes) +newline
      content =content +"DateCreated : " +cstr(datecreated) +newline
      content =content +"DateLastAccessed : " +cstr(DateLastAccessed) +newline
      content =content +"DatelastModified : " +cstr(DatelastModified) +newline
      content =content +"Drive : " +Drive +newline
      content =content +"Name : " +Name +newline
      content =content +"ParentFolder : " +ParentFolder +newline
      content =content +"Path : " +Path +newline
      content =content +"ShortName : " +ShortName +newline
      content =content +"ShortPath : " +ShortPath +newline
      content =content +"Size : " +cstr(Size) +newline
      content =content +"Type : " +cstr(Type1) +newline
   end if
%>


<form name="Form1" Method="Post" Action="info.asp">
<p>Directory : <input type="text" name="dir" cols="25" value="<% =chr(34)& dir1 &chr(34) %>">
<p>File Name : <input type="text" name="filename" cols="25" value="<%=filename1 %>">
<p>File Property:<br> <textarea rows="10" name="Con" cols="40"><%=content %></textarea>
<input type="button" name="ok" value="File Properties" onClick="Ok_OnClick(this.form)">
</form>
<hr>
<a href="infofolder.asp">Folder Property </a> <br>
<a href="default.html">Go Back </a>
</body>
</html>


Copyright © 1998-2002, Halcyon Software Inc. All rights reserved.