473,406 Members | 2,217 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Media removed

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
Mar 17 '07 #1
1 908
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

Mar 18 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Garmt de Vries | last post by:
For a long time, I've used CSS to style my webpages, but only for media "screen" and "print". Now I've started looking into styling them for other media like "projection" and "handheld". I'd be...
11
by: Wolfgang Meier | last post by:
Hi, I really hope I'm not hitting a frequently asked question here, because I think almost every author must have made that decision. Anyway, here goes: Would it be better to write one global...
4
by: rajbala | last post by:
Hi, I want code in javascript in which i can able to drag and drop components between the frames. At same my condition are that it doesn't removed from first frame in which we are going to...
4
by: subeen | last post by:
Hi, I am trying to parse a rss similar to the one found here (in example) http://www.feedforall.com/mediarss.htm <!-- Snipped for Brevity --> <item> <title>FeedForAll's Show Tunes and...
0
by: Konrad | last post by:
Hi everyone. I've got problem with converting xml file to xsd schema. The Xml file looks like: <?xml version="1.0" encoding="iso-8859-2"?> <rss version="2.0"...
0
by: kplazinski | last post by:
Hi everyone. I've got problem with converting xml file to xsd schema. The Xml file looks like: <?xml version="1.0" encoding="iso-8859-2"?> <rss version="2.0"...
0
by: kplazinski | last post by:
Hi everyone. I've got problem with converting xml file to xsd schema. The Xml file looks like: <?xml version="1.0" encoding="iso-8859-2"?> <rss version="2.0"...
0
by: =?Utf-8?B?Um9iZXJ0?= | last post by:
I am not a novice user but this one really is a puzzle. When ever I use Media player to burn songs to a blank cd it creates duplicate songs on the CD. Sometimes they are one after another and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.