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

<%@ language=jscript %>
<%Response.expires=0 %>

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

</head>
<body>
<%
   var fs
   var fi
   var dir1
   var filename1
   var content
   var attributes   
   var datecreated
   var datelastaccessed
   var datelastmodified
   var drive
   var name
   var parentfolder
   var path
   var shortname
   var shortpath
   var size
   var type1
   var fDateCreated=""
   var fDateLastAccessed=""
   var fdatelastmodified=""
   var fDrive=""
   var fFiles=""
   var fIsRootFolder=""
   var fName=""
   var fParentFolder=""
   var fPath=""
   var fShortName=""
   var fShortPath=""
   var fSize=""
   var fSubFolders=""

   var newline=""
   newline ="\n"
   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 +"Files : " +fFiles +newline
   content =content +"IsRootFolder : " +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 : " +fSize +newline

 
   var fs =Server.CreateObject("Scripting.FileSystemObject")
   var tempvar
 
   tempvar =new String (fs.GetFile(Server.mappath("default.html")).parentfolder )
   if (tempvar.indexOf("/") !=-1)
      dir1 =tempvar.concat("/")
   else
      dir1 =tempvar.concat("\\")

   if(Request.Form("dir").Count!=0){
      dir1 =Request.Form("dir")
      var fi =fs.GetFolder(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
      var fDateLastAccessed="";
      content =content +"DateCreated : " +fdatecreated +newline
      content =content +"DateLastModified : " +fdatelastmodified +newline
   
      content =content +"Drive : " +fdrive +newline

      content =content +"IsRootFolder : " +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 : " +fsize +newline
   }
%>



<form name="Form1" Method="Post" Action="infofolder.asp">
           <p>Directory : <input type="text" name="dir" cols="25" value="<%  =dir1 %>">
          
          
           <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.