Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Compact Framework / April 2006

Tip: Looking for answers? Try searching our database.

How to cancel (break) File.Copy?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Frankie D. - 10 Apr 2006 13:05 GMT
I would like to create an appropriate file manager in my application. I want
to implement a cancelable file copy function with a Form which contains
processbar and cancel button.

Is there a way to cancel copy operation?

If I create appropriate file copy operation which is the best strategy? Copy
step by step (megabyte by megabyte) in a copy thread? Because I can break my
loop.  How much should be one step: byte, megabyte, other?

Do you have any idea?

Thanks

Frankie  
Daniel Moth - 20 Apr 2006 15:13 GMT
The fact that it is not straightforward on the desktop
(http://msdn.microsoft.com/msdnmag/issues/05/02/NETMatters/) makes me think
it will be at least awkward on the device.

As for the "strategy" question... In this or other scenarios where you want
to do some long processing and at the same time show progress and/or offer
cancellation, the answer is the same: only you know every how often you
should do that. What is acceptable for your users is something you can
determine and nobody else. If you don't know how long each task takes, then
measure and decide.

Since we are talking about long running tasks, cancellation and progress, I
must mention as a generic reference that may be useful to you in the future
the BackgroundWorker from SDF form OpenNETCF:
http://www.danielmoth.com/Blog/2004/12/backgroundworker-sample.html

Cheers
Daniel
--
http://www.danielmoth.com/Blog/

>I would like to create an appropriate file manager in my application. I
>want
[quoted text clipped - 14 lines]
>
> Frankie

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.