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

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

</head>
<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 fDateCreated
   dim fDateLastAccessed
   dim fDateLastModified
   dim fDrive
   dim fFiles
   dim fIsRootFolder
   dim fName
   dim fParentFolder
   dim fPath
   dim fShortName
   dim fShortPath
   dim fSize
   dim fSubFolders
   dim newline
   newline =chr(13)
   content= "FOLDER PROPERTIES ARE : " +newline  
   content =content +"DateCreated : " +fdatecreated +newline
   content =content +"DateLastAccessed : " +fDateLastAccessed +newline
   content =content +"DatelastModified : " +fDatelastModified +newline
   content =content +"Drive : " +fDrive +newline
   content =content +"IsRootFolder : " +cstr(fIsRootFolder) +newline
   content =content +"Name : " +fName +newline
   content =content +"ParentFolder : " +fParentFolder +newline
   content =content +"Path : " +fPath +newline
   content =content +"ShortName : " +fShortName +newline
   content =content +"ShortPath : " +fShortPath +newline
   content =content +"Size : " +cstr(fSize) +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

   if not isempty(request.form("dir")) then
      dir1 =request.form("dir")
      set fi =fs.GetFolder(trim(dir1) )     
      fdatecreated =fi.Datecreated
      fdatelastmodified =fi.datelastmodified
      fdrive =fi.drive  
      fIsRootFolder=fi.IsRootFolder
      fname= fi.name
      fparentfolder=fi.parentfolder
      fpath =fi.path
      fshortname=fi.shortname
      fshortpath=fi.shortpath
      fsize=fi.size

      content= "FOLDER PROPERTIES ARE : " +newline  
      content =content +"DateCreated : " +cstr(fdatecreated) +newline
      content =content +"DateLastAccessed : " +cstr(fDateLastAccessed) +newline
      content =content +"DatelastModified : " +cstr(fDatelastModified) +newline
      content =content +"Drive : " +fDrive +newline
      content =content +"IsRootFolder : " +cstr(fIsRootFolder) +newline
      content =content +"Name : " +fName +newline
      content =content +"ParentFolder : " +fParentFolder +newline
      content =content +"Path : " +fPath +newline
      content =content +"ShortName : " +fShortName +newline
      content =content +"ShortPath : " +fShortPath +newline
      content =content +"Size : " +cstr(fSize) +newline
    
   end if
%>



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

<a href="default.html">Go Back </a>
</body>
</html>


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