【发布时间】:2012-12-10 20:23:28
【问题描述】:
我正在通过服务器对象使用经典 asp 访问虚拟文件夹中的文件。这是获取文件夹的代码:
Set FSO = Server.CreateObject("Scripting.FileSystemObject")
Dim mapPath
mapPath = Server.MapPath("http://development/far/")
Set farFolder = FSO.GetFolder(mapPath)
循环浏览目录时出现文件未找到错误。当我将 //development/far/ 放在浏览器中时,可以看到这些文件。我对asp还很陌生,所以不知道哪里出了问题。
这是循环目录时的代码:
For Each item in farFolder.Files
Set matches = re.Execute(item.Name)
if(matches.Count=1) then
Response.Write ("<a target=""_blank""href=""" & item.Path & """>" & item.Name & "</a> <br>")
End if
Next
【问题讨论】:
-
向我们展示循环目录并产生文件未找到错误的代码。
标签: asp-classic vbscript virtual-directory file-not-found