Can someone help me with the following problem:
I have created a FileSystemWatcher (fsw) to monitor creation of *.txt file on a mapped directory (the directory is on a Win98 system) the application works fine (events are triggering) when it is running on a WinXP system, but the same application did not get any event trigger when it is runnig on a Win2K system. Any idea?
public sub star ching()
Dim fnc As String = mkMyName & "startRunning:"
writeToLog(fnc & "Entering", TraceLevel.Verbose)
Clear up current data files
moveFile()
If Not mbSetupCompleted Then
writeToLog(fnc & "Setup FileWatcher for the first time", TraceLevel.Off)
moFileWatcher.SynchronizingObject()
Watch for changes in LastAccess and LastWrite times, and
the renaming of files.
moFileWatcher.NotifyFilter = (NotifyFilters.LastAccess Or _
NotifyFilters.FileName)
Add event handlers.
AddHandler moFileWatcher.Changed, AddressOf OnChanged
AddHandler moFileWatcher.Created, AddressOf OnChanged
mbSetupCompleted = True
End If
Begin watching.
writeToLog(fnc & "Enable FileSystemWatcher", TraceLevel.Verbose)
moFileWatcher.EnableRaisingEvents = True
end sub
Private Sub OnChanged(ByVal source As Object, ByVal e As FileSystemEventArgs)
Dim fnc As String = mkMyName & "HandleFileSystemEvent:"
writeToLog(fnc & "Event triggered.", TraceLevel.Verbose)
moveFile()
If (isFileToMove()) Then
If there are files in the source, need to check a gain later!!!!
.....
End If
End Sub
I have created a FileSystemWatcher (fsw) to monitor creation of *.txt file on a mapped directory (the directory is on a Win98 system) the application works fine (events are triggering) when it is running on a WinXP system, but the same application did not get any event trigger when it is runnig on a Win2K system. Any idea?
public sub star ching()
Dim fnc As String = mkMyName & "startRunning:"
writeToLog(fnc & "Entering", TraceLevel.Verbose)
Clear up current data files
moveFile()
If Not mbSetupCompleted Then
writeToLog(fnc & "Setup FileWatcher for the first time", TraceLevel.Off)
moFileWatcher.SynchronizingObject()
Watch for changes in LastAccess and LastWrite times, and
the renaming of files.
moFileWatcher.NotifyFilter = (NotifyFilters.LastAccess Or _
NotifyFilters.FileName)
Add event handlers.
AddHandler moFileWatcher.Changed, AddressOf OnChanged
AddHandler moFileWatcher.Created, AddressOf OnChanged
mbSetupCompleted = True
End If
Begin watching.
writeToLog(fnc & "Enable FileSystemWatcher", TraceLevel.Verbose)
moFileWatcher.EnableRaisingEvents = True
end sub
Private Sub OnChanged(ByVal source As Object, ByVal e As FileSystemEventArgs)
Dim fnc As String = mkMyName & "HandleFileSystemEvent:"
writeToLog(fnc & "Event triggered.", TraceLevel.Verbose)
moveFile()
If (isFileToMove()) Then
If there are files in the source, need to check a gain later!!!!
.....
End If
End Sub