すべてのファイル名を取得し、文字列配列に保存しました。コードは次のとおりです。
Dim fi As System.IO.FileInfo
Dim file_size As Int32
'all file names are stored in Files string array
Dim Files() As String
Dim CurrentFile As String
For Each CurrentFile In Files
fi = New System.IO.FileInfo(CurrentFile)
file_size = fi.Length
Next
これは、各ファイルのサイズを取得する正しい方法ですか? ファイルサイズを取得するより良い方法はありますか? 何千ものファイルがあり、より良いアプローチを探しています。