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 編輯過 |
關鍵字查詢
相關文章
正在查詢... |