vb.net - Handling connection loss on FileSystemWatcher -


I have an error handler so that when the network connection falls, it checks that the connection has been restored And then again FileSystemWatcher starts to do this, I currently run this code:

  Sub-Disturb (byVal source as the object, ByVal and like _ System.IO.ErrorEventArgs). .BalloonTipText = "Connection to folder is lost" Me.NotifyIcon1. BalloonTipTitle = "Connection Lost" Me.NotifyIcon1.ShowBalloonTip (6000) Dir ("\\ My \ Path", vb directory) & lt; & Gt; VbNullString application.DoEvents () loop watchfolder = nothing. Notification Icon1 Bulunipt Icon = ToolTipIcon.Info Me.NotifyIcon1 BULLANTIP TEXT = "try re-connection" me.NotifyIcon1. BalloonTipTitle = "Trying to reconnect in folder" Me.NotifyIcon1.ShowBalloonTip (6000) checkItem () last sub   

I expected as long as ... loop will work to check that the connection is working again, but it does not look like this and so this is the rest of the code (first shows tooltip, so I know it is not an issue with my error handler) Does not continue through

This is not the best way to investigate Can restore the connection, but I really do not see why it will not work if it certainly will not, then it can tell that it should do or if it should be, so what am I missing something here? Please also note that I am quite new at VB.Net :)

In addition, you should check this, checkItem is running the following process (as well as some logging that has not been displayed here )

  watchFolder = New system. Ioophil systemware () clockfolder. Path = "\\ My \ Path \" watchFolder. These cludeSubdirectories = True watchFolder.Reserving events = True watchfolders. Nodefiler = IO.NotifyFilters.DirectoryName watchFolder.NotifyFilter = watchFolder.NotifyFilter or IO.NotifyFilters.FileName watchFolder.NotifyFilter = watchFolder.NotifyFilter or IO.NotifyFilters.Attributes AddHandler WatchFolder.Changed, AddAddOff LogonHandler WatchFolder.Created, FindWeb Logon AddHandler WatchFolder Deleted, Ptaof Logboard AddHandler watchFolder.Error, ruction AddHandler know WatchFolder.Renamed, AddressOf logrename    

The problem is found in the Dir section at the end of my path, a "\" form is missing. It now reads

  Dir Dir "(\\ My \ path \" , Vb directory) & lt; & Gt; VbNullString application. DoEEvents () Loop   

that works fine

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -