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 I expected 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 ) The problem is found in the that works fine 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
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
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
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
Comments
Post a Comment