0
この行のメモリに格納されているシステムの量(For Each objFile in objFolder.Files
)と、objFile.Files.Count
のようなものを使用して反復処理する方がより効果的かどうかはわかりません。次のコードを使用するとパフォーマンス上の問題が発生するかどうかは誰にも分かりますか?FileSystemObjectコレクションの繰り返しでのパフォーマンスチューニング
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