ASP 取得目錄 & 檔案 & 檔案資訊 FileSystemObject

ASP 取得目錄 & 檔案 & 檔案資訊 FileSystemObject

Dim objFSO , objFolder , objFile
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")

If objFSO.FolderExists(Server.MapPath("\目錄")) then
Set objFolder = objFSO.GetFolder(Server.MapPath("\目錄"))
For Each objFile in objFolder.SubFolders
 Response.Write("子目錄:")
 Response.Write objFile.Name & "<BR>"
Next

For Each objFile in objFolder.Files
 Response.Write("檔案:")
 Response.Write objFile.Name & "<BR>"
Next
End if

Set objFolder = nothing
Set objFSO = nothing

留言

這個網誌中的熱門文章

delivery note和delivery order的區別和翻譯

Eclipse 3.6.1 Helios 中文化方法

牙技專業英文--技工篇