FileSystemWatcher

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • calvin

    #1

    FileSystemWatcher


    Can someone help me with the following problem:

    I have created a FileSystemWatch er (fsw) to monitor creation of *.tx
    file on a mapped directory (the directory is on a Win98 system) th
    application works fine (events are triggering) when it is running on
    WinXP system, but the same application did not get any event trigge
    when it is runnig on a Win2K system. Any idea?


    public sub star ching()
    Dim fnc As String = mkMyName & "startRunni ng:"
    writeToLog(fnc & "Entering", TraceLevel.Verb ose)

    'Clear up current data files
    moveFile()

    If Not mbSetupComplete d Then
    writeToLog(fnc & "Setup FileWatcher for the first time"
    TraceLevel.Off)
    'moFileWatcher. SynchronizingOb ject()
    ' Watch for changes in LastAccess and LastWrite times, and
    ' the renaming of files.
    moFileWatcher.N otifyFilter = (NotifyFilters. LastAccess Or _
    NotifyFilters.F ileName)
    ' Add event handlers.
    AddHandler moFileWatcher.C hanged, AddressOf OnChanged
    AddHandler moFileWatcher.C reated, AddressOf OnChanged
    mbSetupComplete d = True
    End If

    ' Begin watching.
    writeToLog(fnc & "Enable FileSystemWatch er", TraceLevel.Verb ose)
    moFileWatcher.E nableRaisingEve nts = True
    end sub



    Private Sub OnChanged(ByVal source As Object, ByVal e A
    FileSystemEvent Args)
    Dim fnc As String = mkMyName & "HandleFileSyst emEvent:"
    writeToLog(fnc & "Event triggered.", TraceLevel.Verb ose)
    moveFile()

    If (isFileToMove() ) Then
    'If there are files in the source, need to check a gain later!!!!
    .....
    End If
    End Su

    calvi
    -----------------------------------------------------------------------
    Posted via http://www.mcse.m
    -----------------------------------------------------------------------
    View this thread: http://www.mcse.ms/message332940.htm

Working...