Well, I used FileSystemWatcher to monitor the shared folder that exists on another computer on the network, and here is my experience:
- You can check the connection through
File.Exists or Folder.Exists . FileSystemWatcher will not throw an exception if you lose the connection to this shared folder. Instead, whenever the connection is lost, you will receive this error message: " The specified network name is no longer available . When you receive this error, the FSW will no longer process any data, even if the connection is restored, so handle the event FileSystemWatcher.Error , and if an error is raised, reset EnableRaisingEvents to true again or reinitialize FSW
source share