Dear friends,
Part of my code always work fine under Windows 7, now with Windows 10 not works...
The code count Files and Folders inside a External Hard Drive, the same device is used for testing...
Public NDirs, NFiles As Integer
Try
NDirs = My.Computer.FileSystem.GetDirectories(My.Settings.BackupDrive, "*",
SearchOption.AllDirectories).Count
NFiles = My.Computer.FileSystem.GetFiles(My.Settings.BackupDrive, "*.*",
SearchOption.AllDirectories).Count
Catch ex As Exception
Finally
MsgBox("Total Files: " & NFiles.ToString & " / Folders: " & NDirs.ToString)
End Try
I am not sure is something about the .Net Frameworks (4.0 on Proyect) or something else, just try many options and dont works...
On Win7 get the correct files folder numbers, on Win10 just 0/0.
I read some post in the site, where said about GetDirectories /Files not is a good option and very slow, so can give me some orientation for better way?
Thank you in advance.
What I have tried:
Also I try with Directory.GetDirectories and used convinations at the end like .Count, .LongCount, .Lenght and dont works under Windows 10