Hi all,
I adapted a piece of code (recursive LINQ query) to generate a BindingList(of FileInfo) over a LAN. That works well on a local computer, and it seems to be fine on most of the remote network computers, too.
There seems to be a problem with the query, I guess, since I eventually get error message that "A part of the network path could not be found". This appears odd considering that the query reads paths first – and then can't find then...
(EDIT: I've checked that the path's throwing an error are existing and there's also no security issue with them. It must be something in the code)
In my strong believe that Alzheimer's wouldn't spread to Computers: Can someone please help me clear up the confusion as well as, if needed, correct the syntax?
Thank you very much,
Kind regards
Michael
What I have tried:
Try
For Each result As FileInfo In dirInfo.GetFiles(pattern).Select(Function(file) file).Where(Function(s) supportedExtensions.Contains(Path.GetExtension(s.Extension).ToLower()))
queue.Enqueue(result)
report(dirInfo.FullName)
Next result
Task.WaitAll(dirInfo.GetDirectories().Select(
Function(d) Task.Factory.StartNew(
Sub() InternalCollectFiles(d, pattern, queue))).ToArray())
Catch e As UnauthorizedAccessException
Catch e As SecurityException
Catch e As DirectoryNotFoundException
MsgBox(String.Format("Error: {0}", e.Message))
Catch ex As Exception
MsgBox(String.Format("Error in 'InternalCollectFiles': {0}", ex.Message))
End Try