Есть ли более быстрый способ перечислить папки и файлы, чем enumeratefiles?
I have a list of directories (121) that I want to generate all the files inside of them including sub directories. There are about 7300 files and folders inside the original list. EnumerateFiles and GetFiles take forever to populate the list. (8 minutes) I have done a comparison of a cmd line "Dir /s" and the "enumeratefiles" for one of the largest directories. "enumeratefiles" takes about 35 seconds, and "Dir /s" takes 2 seconds. I am just looking for a list of files and folders with their complete path name such as what you get from the cmd line "Dir /s". Is there a faster method for me to get this list? I have been trying the VB "Dir(filename)" but cannot seem to get this to work. The original list of files is coming from an array that I have previously populated. I'm new at this so I am probably not using good coding practices. :/
Что я уже пробовал:
Для каждого имени файла в виде строки в IO.Каталог.EnumerateFiles("o:\tapes\maxim500\dnc", "*", IO.SearchOption.AllDirectories)
Если TextBox1.Text = "", То
Текстовое поле textbox1.Текст = именем
Еще
Текстовое поле textbox1.Текст = Элемент Textbox1.Текст &амп; vbNewLine &амп; именем
Конец, Если
Следующий