Hi,
I am using the above function to Output all the files in the Temporary Internet Files folder - its working alright. But its very slow and also hangs.
I was wondering if theres a better method to do this.
Thank you
Regards
Code:
Public Sub FindInternetCache()
Dim cacheDir As String = Environment.GetFolderPath(Environment.SpecialFolder.InternetCache)
Dim cacheFiles As ReadOnlyCollection(Of String) = My.Computer.FileSystem.GetFiles(cacheDir, FileIO.SearchOption.SearchAllSubDirectories, "*.*")
Dim fCounter As Integer = 0
Dim fSize As Double
For Each cacheFound As String In cacheFiles
fCounter = fCounter + 1
DisplayBox.Text &= Environment.NewLine
DisplayBox.Text &= "Found: " & cacheFound & Environment.NewLine
fSize += My.Computer.FileSystem.GetFileInfo(cacheFound).Length
Next
DisplayBox.Text &= Environment.NewLine
DisplayBox.Text &= "IE Temporary Internet Files Found " & "(" & fCounter & " Files) " & SetBytes(fSize) & Environment.NewLine
End Sub
I was wondering if theres a better method to do this.
Thank you
Regards
Comment