We have some basic C# logic that iterates over a directory and returns the folders and files within. When run against a network share (\\\\server\\share\\folder) that is ina
See...
Faster DirectoryExists function?
...for a way of setting the execution time for Directory.Exists
Perhaps you could try pinging the server first, and only ask for the directory info if you get a response?
You can use this code:
var task = new Task<bool>(() => { var fi = new FileInfo(uri.LocalPath); return fi.Exists; });
task.Start();
return task.Wait(100) && task.Result;
Place it on its own thread, if it doesn't come back in a certain amount of time, move on.