09-30-2015 12:26 PM
Since I haven't been too familiar with .NET in any language, I'd figure I'd start out with something simple like the FileSystemWatcher. I was wondering if anyone had any experience with the this constructor. How do I make .NET trigger when a file has changed?
I went by the example on the MSDN site for this, but I've hit a snag. Can anyone help? I've included the VI below.
Solved! Go to Solution.
09-30-2015 12:39 PM
09-30-2015 01:31 PM
I wrote a version of soemthing like this once.
The thing to keep in mind is that different applications read and write to files in different ways.
I found Notepad generated multiple events for a single save. Not very friendly 😞
Another FileSystemWatcher example can be found here:
http://blog.jki.net/labs/dont-throw-away-your-throw-away-code/
09-30-2015 03:58 PM
@GerdW wrote:
Hi Eric,
why don't you study the ready-to-use example in the LabVIEW community?
I didn't see that on my Google search. Probably just skimmed right over it. Thanks.
06-26-2021 05:01 AM - edited 06-26-2021 05:05 AM
@Eric1977 wrote:
Since I haven't been too familiar with .NET in any language, I'd figure I'd start out with something simple like the FileSystemWatcher. I was wondering if anyone had any experience with the this constructor. How do I make .NET trigger when a file has changed?
Callbacks are never simple! 😁 LabVIEW tries to hide away some of the complications but only manages in a limited way to do that. It's definitely not straightforward programming and in a way goes completely against LabVIEW dataflow programming, which is why they chose to implement it as an event in .Net. Unfortunately .Net events don't map easily to LabVIEW events.
Whenever I had to deal with events in .Net or Java code in the past I always had to pinch myself a few times to get my mind wrapped around the correct syntax and not make a total mess of the implementation.