|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
filesystemwatcher changed vb.netHi all,
I have implemented a filesystemwatcher to notify my app when a specific file has changed. I have a notifyfilter of LastWrite or Size. However, just opening the file is triggering this. Is there a way around this since I only want to know when changes have been made ? Mark <marf***@yahoo.com> schrieb:
> I have implemented a filesystemwatcher to notify my app when a specific Short but complete programs> file has changed. I have a notifyfilter of LastWrite or Size. > However, just opening the file is triggering this. Is there a way > around this since I only want to know when changes have been made ? <URL:http://www.pobox.com/~skeet/csharp/complete.html> -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/> All I was saying is that just opening the file I am watching is
triggering a change event. Here is the code: Private Sub SetWatcherData() watcher.Path = ValidateNetworkFileItemPath ' -- set notification for when the validation file is updated watcher.NotifyFilter = (NotifyFilters.LastWrite Or NotifyFilters.Size) watcher.Filter = ValidateItemFileName ' Add event handlers. AddHandler watcher.Changed, AddressOf OnSerializedFileChanged ' Begin watching. watcher.EnableRaisingEvents = True End Sub Private Sub OnSerializedFileChanged(ByVal source As Object, ByVal e As FileSystemEventArgs) MsgBox(e.ChangeType & " " & e.FullPath & " " & e.Name) End Sub By just opening the file specified in the variable (ValidateItemFileName), the event is getting triggered.
How to debug this?
Mixing VB variables with standard text to output text file foxpro table hosed up when called 2nd time from VB.net Creating array on the fly as a parameter to a subroutine? Line Numbers in RichTextBox.. OT: ILMerge Polymorphic XML Serialized Array Using SQL substring query in vb.net app Using an event defined in an interface IPC Examples in VB.net? |
|||||||||||||||||||||||