Handle File Operation/Camera Event - Possible?
Hi. I'm using WM6 SDK, writing my program in VB.NET.
This time I need to do something on file operation. Namely, deletion on files. However, this project require me to delete file upon its creation.
One method I thought of and wrote is to get a list of files and folders and place them in a ignorelist, then use a timer to constantly delete files that are not in the list. This method was rejected.
Is there a way to do this without the use of timer?
Re: Handle File Operation Event - Possible?
Take a look at the FileSystemWatcher class in the OpenNETCF library which is an implementation of the FileSystemWatcher in the full framework
Re: Handle File Operation Event - Possible?
Hmm. It appeared that FileSystemWatcher only appear when I try WindowsApplication, it doesn't seems to work for DeviceApplication.
Re: Handle File Operation Event - Possible?
Yes - that is why I said you needed OpenNetCF
Re: Handle File Operation/Camera Event - Possible?
Thanks. I currently have a new problem. Is there a way to handle an event of a picture being taken by the camera?
Re: Handle File Operation/Camera Event - Possible?
You mean pick up if a picture has been taken outside your application?
Monitor the folder where the camera stores its images, and see if it changes would do it
Re: Handle File Operation/Camera Event - Possible?
That's what I'm currently doing. Unfortunately, my supervisor wants me to prevent the user that have installed 3rd party camera software to used the camera using that software and save the file to another place.
I thought of using the same logic by monitoring the entire file system and delete any file ending with .jpg but I was told, it may affect other image file operation.
Any way around that?
Re: Handle File Operation/Camera Event - Possible?
Well, with the normal camera s/ware, the user can choose a folder and choose names for the pictures.
I would guess though, that the next in sequence is held in the registry - so if you find out where, you can monitor that for changes.
I would dump the registry to a file, take a picture, then re-dump, and compare the files - or just browse the registry looking for likely suspects containing 'camera'
Re: Handle File Operation/Camera Event - Possible?
Thanks for the tip. I manage to do that. Just a curious side, is there really no way to disable/enable the camera hardware or driver by making use of VB.NET codes?
Re: Handle File Operation/Camera Event - Possible?
rename camera.exe to something else?
Re: Handle File Operation/Camera Event - Possible?
There is a great 'How Do I' video here from Maarten Struys that will give you a good idea of how to monitor for a photograph being taken