vb.net - FileSystemWatcher - Reduce Multiple Event Raising (or Reduce Results of Multiple Events) in Visual Basic (VS 2012 V11) -


i'm trying reduce number of events raised 1 when filesystemwatcher changes (or @ least display text in textbox once when event raised, either removing duplicate text or other method).

is there fix in visual basic, or @ least anyway remove duplicated text have being appended status log textbox (when onchange sub called)?

i've done decent amount of research on , looks there no "simple" fix.


here list of resources:


additional information:

private sub formbackupfile_load(byval sender system.object, byval e _  system.eventargs) handles mybase.load  dim varfilesystemwatcher new filesystemwatcher() dim directorypath string = path.getdirectoryname(textboxfilelocation.text)         varfilesystemwatcher.synchronizingobject = me         varfilesystemwatcher.path = directorypath         varfilesystemwatcher.notifyfilter = (notifyfilters.lastwrite)  ' event raised twice or more addhandler varfilesystemwatcher.changed, addressof onchanged varfilesystemwatcher.enableraisingevents = true  end sub   private sub onchanged(source object, e filesystemeventargs)         ' stops filesystemwatcher firing twice or more but,         ' works @ random.         varfilesystemwatcher.enableraisingevents = false          ' copies specified file specified location         my.computer.filesystem.copyfile(e.fullpath, textboxcopyto.text & "\" _          & e.name, true)          ' text added textbox twice or more.         textboxstatuslog.appendtext(environment.newline & environment.newline & _          statusupdate)          ' starts filesystemwatcher again         varfilesystemwatcher.enableraisingevents = true  end sub 


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -