asp获取文件夹的大小
|
admin
2010年7月16日 18:34
本文热度 5265
|
以下是代码片段:
<%
dim objfso,objfolder '声明一个名称为 objfso 的变量以存放对象实例
set objfso = server.createobject("scripting.filesystemobject")
if objfso.folderexists(server.mappath("\")) then
response.write "上一级目录:" &objfso.getparentfoldername(server.mappath("\"))&"
"
response.write "系统文件夹目录:" &objfso.getspecialfolder(windowsfolder)&"
"
set objfolder = objfso.getfolder(server.mappath("\"))
response.write "文件夹的名称:"&objfolder.name&"
"
response.write "文件夹的路径:"&objfolder.path&"
"
response.write "文件夹的路径:"&objfolder.size/1024/1024&"
"
response.write "文件夹的建立日期:"&objfolder.datecreated&"
"
else
response.write "文件夹"&server.mappath("\new\work\newfolder")&"不存在,无法读取相关信息!"
end if
set objfolder = nothing
set objfso = nothing '释放 filesystemobject 对象实例内存空间
%>
该文章在 2010/7/16 18:34:49 编辑过