asp获取文件夹的大小
当前位置:点晴教程→知识管理交流
→『 技术文档交流 』
[p][color=#990000]以下是代码片段:[/color][br][/p]
[p]<% [br] dim objfso,objfolder '声明一个名称为 objfso 的变量以存放对象实例 [br] set objfso = server.createobject("scripting.filesystemobject") [br] if objfso.folderexists(server.mappath("\")) then [br] response.write "上一级目录:" &objfso.getparentfoldername(server.mappath("\"))&" " [br] response.write "系统文件夹目录:" &objfso.getspecialfolder(windowsfolder)&" " [br] set objfolder = objfso.getfolder(server.mappath("\")) [br] response.write "文件夹的名称:"&objfolder.name&" " [br] response.write "文件夹的路径:"&objfolder.path&" " [br] response.write "文件夹的路径:"&objfolder.size/1024/1024&" " [br] response.write "文件夹的建立日期:"&objfolder.datecreated&" " [br] else [br] response.write "文件夹"&server.mappath("\new\work\newfolder")&"不存在,无法读取相关信息!" [br] end if [br] set objfolder = nothing [br] set objfso = nothing '释放 filesystemobject 对象实例内存空间 [br] %> [/p] 该文章在 2010/7/16 18:34:49 编辑过 |
关键字查询
相关文章
正在查询... |