以下是代碼片段:
<%
dim objfso,objfolder '聲明一個名稱為 objfso 的變量以存放對象實例
set objfso = server.createobject("scripting.filesystemobject")
if objfso.folderexists(server.mappath("\")) then
response.write "上一級目錄:" &objfso.getparentfoldername(server.mappath("\"))&"
"
response.write "系統(tǒng)文件夾目錄:" &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 編輯過