-
您的位置:首页 → 精文荟萃 → 软件资讯 → 简单的文件目录浏览源程序
简单的文件目录浏览源程序
时间:2004/10/7 19:18:00来源:本站整理作者:蓝点我要评论(0)
-
'**************************************
' Name: File / Directory Viewer
' Description:This Will Display All The
' Files, File Size and file date of every
' file in the directory you specify.
To make this work, paste the code into your favorite html editor, save it and Then view it.
' By: Thomas Michael
'
'
' Inputs:None
'
' Returns:None
'
'Assumes: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, fitness, merchantability,and any othe
' r warranty (whether expressed 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
' sonal projects and may compile it into a
' n .exe/.dll/.ocx and distribute it in bi
' nary format freely and with no charge.
' 2) You MAY NOT redistribute this sourc
' e code (for example to a web site) witho
' ut written permission 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 website, provided it is not wrapped
' 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.
'**************************************
<%@ LANGUAGE="VBSCRIPT" %>
<% Option Explicit %>
File Viewer
Title |
Size |
Date |
<%
'File System Object
Dim objFSO
'File Object
Dim objFile
'Folder Object
Dim objFolder
'String To Store The Real Path
Dim sMapPath
'Create File System Object To Get list of files
Set objFSO = CreateObject("Scripting.FileSystemObject")
'Get The path For the web page and its dir.
'change this setting To view different directories
sMapPath = "C:\Mydocu~1"
'Set the object folder To the mapped path
Set objFolder = objFSO.GetFolder(sMapPath)
'For Each file In the folder
For Each objFile In objFolder.Files
%>
">
<%
'write the files name
Response.Write objFile.Name
%>
|
<%
'We will format the file size so it looks pretty
If objFile.Size <1024 Then
Response.Write objFile.Size & " Bytes"
ElseIf objFile.Size < 1048576 Then
Response.Write Round(objFile.Size / 1024.1) & " KB"
Else
Response.Write Round((objFile.Size/1024)/1024.1) & " MB"
End If
%>
|
<% 'the files Date
Response.Write objFile.DateLastModified
%>
|
<%
Next
%>
相关阅读
Windows错误代码大全 Windows错误代码查询激活windows有什么用Mac QQ和Windows QQ聊天记录怎么合并 Mac QQ和Windows QQ聊天记录Windows 10自动更新怎么关闭 如何关闭Windows 10自动更新windows 10 rs4快速预览版17017下载错误问题Win10秋季创意者更新16291更新了什么 win10 16291更新内容windows10秋季创意者更新时间 windows10秋季创意者更新内容kb3150513补丁更新了什么 Windows 10补丁kb3150513是什么
-
热门文章
360快剪辑怎么使用 36金山词霸如何屏幕取词百度收购PPS已敲定!3
最新文章
微信3.6.0测试版更新了微信支付漏洞会造成哪
360快剪辑怎么使用 360快剪辑软件使用方法介酷骑单车是什么 酷骑单车有什么用Apple pay与支付宝有什么区别 Apple pay与贝贝特卖是正品吗 贝贝特卖网可靠吗
人气排行
xp系统停止服务怎么办?xp系统升级win7系统方电脑闹钟怎么设置 win7电脑闹钟怎么设置office2013安装教程图解:手把手教你安装与qq影音闪退怎么办 QQ影音闪退解决方法VeryCD镜像网站逐个数,电驴资料库全集同步推是什么?同步推使用方法介绍QQ2012什么时候出 最新版下载EDiary——一款好用的电子日记本
查看所有0条评论>>