Hi guys,

i was wondering if any of you could help, i am creating a logging app that records audio and video and saves the data to a USB stick/drive every minute.

Everything works fine, and i have been testing to see if i could get it to crash when using is (and i can).

I use a background worker thread to compress the temporary files and save them to the USB drive every 60 seconds, however if i remove the USB drive once it starts writing i get a SystemIOException.

I have tried different things like using a try/catch statement in the background worker thread to cancel the thread, but still get this exception.

The program will be used by people who i know will do this even thigh the manual states to press the USB eject button and wait for the program to report the USB drive can be removed.

My question is how to i stop this error crashing the program, every other part of the program seems to work great and i just cant seem to see how to overcome this.

Any help is appreciated.