|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Timer Event Not Firing in SystemFileWatcher...I've got a bit of a problem... I'm using a SystemFileWatcher to watch for new files that get built in a directory. The problem I have is that the file being written is about 4mb in size. It's being written from one server to another server the file watcher is running on. What I've been trying to do is fire off a timer, in the Change event of the SystemFileWatcher, to try to open the file to see if it's done being written to or not; catching an exception if not and waiting for the next tick event. However, the timer will not fire. I've tried Timer.Start() and Timer.Enabled = True, I've tried both, but to no avail. Does anyone know if this is a bug or not or if I'm doing this wrong? Also, I was using the event from the SystemFileWatcher to accomplish the same task, but occasionally, it wouldn't fire one last time when the file was completed, so I never could accomplish the task I need to accomplish. Does anyone have any better ideas on how to accomplish this, or know if you can use a timer inside the Change event of the SystemFileWatcher class? Thanks, Mike "Mike Andrews" <mi***@farpointer.net> schrieb: Maybe setting the filesystemwachter's 'SynchronizingObject' property to the > I'm using a SystemFileWatcher to watch for new files that get built in a > directory. The problem I have is that the file being written is about 4mb > in > size. It's being written from one server to another server the file > watcher > is running on. What I've been trying to do is fire off a timer, in the > Change event of the SystemFileWatcher, to try to open the file to see if > it's done being written to or not; catching an exception if not and > waiting > for the next tick event. However, the timer will not fire. I've tried > Timer.Start() and Timer.Enabled = True, I've tried both, but to no avail. > Does anyone know if this is a bug or not or if I'm doing this wrong? form the component is placed on will solve the problem. -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/> Thanks alot.
That workd! Later, Mike Show quoteHide quote "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message news:umPskK4PFHA.2132@TK2MSFTNGP14.phx.gbl... > "Mike Andrews" <mi***@farpointer.net> schrieb: > > I'm using a SystemFileWatcher to watch for new files that get built in a > > directory. The problem I have is that the file being written is about 4mb > > in > > size. It's being written from one server to another server the file > > watcher > > is running on. What I've been trying to do is fire off a timer, in the > > Change event of the SystemFileWatcher, to try to open the file to see if > > it's done being written to or not; catching an exception if not and > > waiting > > for the next tick event. However, the timer will not fire. I've tried > > Timer.Start() and Timer.Enabled = True, I've tried both, but to no avail. > > Does anyone know if this is a bug or not or if I'm doing this wrong? > > Maybe setting the filesystemwachter's 'SynchronizingObject' property to the > form the component is placed on will solve the problem. > > -- > M S Herfried K. Wagner > M V P <URL:http://dotnet.mvps.org/> > V B <URL:http://classicvb.org/petition/> >
ASCII lookup table
Datagrid resizing rows on sort - not wanted VB.NET Equiv of... AxWebBrowser1 and code behind redirecting Datagrid - shown vertically instead of horizontally? Reading from a ini-file and run a program Easy one about web forms form location Registering my program as default for my file extension Inherited Treeview control with dynamic context menu. |
|||||||||||||||||||||||