AFAIK, catching the exception is your only option, unless you want to
interface directly with the OS to catch the problem. Now, you obviously have
the option of doing whatever you want to do when catching the exception, so
why not add some custom logic to your catch block? What I mean is that you
recover from the exception, by asking the user to insert the device, and the
you start copying again. If you have several files, why not keep an array of
files that have been successfully copied, and then if you catch the
exception restart the copying from wherever it failed? Just a thought.
--
Carsten Thomsen
Senior .NET Solutions Architect / Developer / Author
MCAD/MCSD/MCSE/MCTS
"Samuel" <sa************@ntlworld.comwrote in message
news:eo**************@TK2MSFTNGP02.phx.gbl...
Hi everyone,
If while I copy files to memory pen the user pulls out the device, I get
an exception saying 'path can't be found' (the exception occurred in the
line of code that creates a folder)
Instead I would like to show the user a message and carry on with the
work. The only way I can figure out is to catch the exception and present
a message box requesting the media in place before the user click on the
OK button.
I wonder what else is available, perhaps something similar to these
messages one gets when installing VS from multiple CDs or even when the CD
is taken out while the installation takes place
Thank you,
Samuel