'**************************************
' Name: File / Directory Viewer
' Description:This Will Di lay All The
' Files, File Size and file date of every
' file in the directory you ecify.
To make this work, paste the code into your favorite html editor, save it and Then view it.
' By: Thomas Michael
'
'
' I uts:None
'
' Retur :None
'
'A umes:File System Object Be Needed :)
' and it is setup to look for you my docum
' ents folder at "c:\mydocu~1" but you can
' change the line of code to look in any d
' irectory.
'
'Side Effects:None
'
'Warranty:
'code provided by Planet Source Code(tm)
' (http://www.Planet-Source-Code.com) 'as
' is', without warranties as to performanc
' e, fitne , merchantability,and any othe
' r warranty (whether expre ed or implied
' ).
'Terms of Agreement:
'By using this source code, you agree to
' the following terms...
' 1) You may use this source code in per
' onal projects and may compile it into a
' .exe/.dll/.ocx and distribute it in bi
' ary format freely and with no charge.
' 2) You MAY NOT redistribute this sourc
' e code (for example to a web site) witho
' ut written permi ion from the original
' author.Failure to do so is a violation o
' f copyright laws.
' 3) You may link to this code from anot
' her we ite, provided it is not wra ed
' in a frame.
' 4) The author of this code may have re
' tained certain additional copyright righ
' ts.If so, this is indicated in the autho
' r's description.
'**************************************
lt;%@ LANGUAGE="V CRIPT" %>
lt;% Option Explicit %>
lt;HTML>
lt;HEAD> <TITLE>File Viewer</TITLE> </HEAD>
lt ODY>
lt;TABLE width="100%" border=1 bordercolor="#000000" align="left" cellpadding="2" cell acing="0" gt;
lt;TR align="left" valign="to quot; bgcolor="#000000" gt;
<TD width="65%" gt lt;FONT color="#FFFFFF" gt lt gt lt;FONT size="2" face="Verdana, Arial, Helvetica, sa -
serif" gt;Title</FONT> lt;/ gt lt;/FONT> lt;/TD>
lt;TD width="10%" gt lt;FONT color="#FFFFFF" gt lt gt lt;FONT size="2" face="Verdana, Arial, Helvetica, sa -
serif" gt ize</FONT> lt;/ gt lt;/FONT> lt;/TD>
lt;TD width="25%" gt lt;FONT color="#FFFFFF" gt lt gt lt;FONT size="2" face="Verdana, Arial, Helvetica, sa -
serif" gt;Date</FONT> lt;/ gt lt;/FONT> lt;/TD>
lt;/TR>
lt;%
'File System Object
Dim objFSO
'File Object
Dim objFile
'Folder Object
Dim objFolder
'String To Store The Real Path
Dim sMa ath
'Create File System Object To Get list of files
Set objFSO = CreateObject(" cripting.FileSystemObject")
'Get The path For the web page and its dir.
'change this setting To view different directories
sMa ath = "C:\Mydocu~1"
'Set the object folder To the ma ed path
Set objFolder = objFSO.GetFolder(sMa ath)
'For Each file In the folder
For Each objFile In objFolder.Files
%>
<TR align="left" valign="to quot; bordercolor="#999999" bgcolor="#FFFFFF" gt;
<TD> <FONT size="2" face="Verdana, Arial, Helvetica, sa -serif" color="#000000" gt lt;A href=" lt;% =
sMa ath &am "/" &am objFile.Name %> quot gt;
<%
'write the files name
Re o e.Write objFile.Name
%>
</A>
</FONT>
</TD>
lt;TD>
<FONT size="2" face="Verdana, Arial, Helvetica, sa -serif" color="#000000" gt;
<%
'We will format the file size so it looks pretty
If objFile.Size <1024 Then
Re o e.Write objFile.Size &am " Byte quot;
ElseIf objFile.Size < 1048576 Then
Re o e.Write Round(objFile.Size / 1024.1) &am " K quot;
Else
Re o e.Write Round((objFile.Size/1024)/1024.1) &am " M quot;
End If
%>
</FONT>
</TD>
lt;TD>
<FONT size="2" face="Verdana, Arial, Helvetica, sa -serif" color="#000000" gt;
<% 'the files Date
Re o e.Write objFile.DateLastModified
%>
</FONT>
</TD>
</FONT>
</TD>
</TR>
<%
Next
%>
lt;/TABLE>
lt;/BODY>
lt;/HTML>
an>


