Hi all, I'm currently developing a windows service in VB.NET that will be deployed on multiple machines. The services are responsible for polling a specific location on a shared file system and consume the files therein. A website is responsible for initially placing the files in this shared file system location.
I'm not sure how to design my service so that when it is deployed on multiple devices and begin reading and consuming files, those files are locked so that other instances of the service cannot access them. A single instance of the service must: -Get a list of the files on the shared file system -lock the files so that other instances of the same service on other devices do not access them -backup the files to predetermined locations -Open, read, and consume the data contained within the files -delete the files from the original directory -be able to recover from programmatic crashes during file consumption so the files do not end up in a "limbo" state when the service is restarted. Any ideas or examples out there on how to do this? I've thought about the simple "rename" solution, but it is prone to errors if a process crashes, since other instances of the service will never look for renamed files. Any help would be appreciated. -Jason
