【发布时间】:2012-05-02 16:12:11
【问题描述】:
我不知道系统在For Each objFile in objFolder.Files 这一行的内存中存储了多少,以及使用类似objFile.Files.Count 的东西进行迭代是否会更有益。有谁知道使用以下代码是否会产生任何重大的性能问题?
Dim objFSO
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
'Get the folder object associated with the directory
Dim objFolder
Set objFolder = objFSO.GetFolder("C:\InetPub\wwwroot")
Response.Write "The files found in " & objFolder.Name & ":<br>"
'Loop through the Files collection
Dim objFile
For Each objFile in objFolder.Files
Response.Write objFile.Name & "<br>"
Next
'Clean up!
Set objFolder = Nothing
Set objFile = Nothing
Set objFSO = Nothing
【问题讨论】:
标签: performance filesystemobject fso