473,405 Members | 2,415 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,405 software developers and data experts.

FileInfo.CopyTo (net 1.1)

Hi,

i use the CopyTo - Function to copy large files into a net drive. Now
it would be mad, if I could indicate the remaining time or also the
status (in %) to the copying action. Have unfortunately still nothing
found... Is there a possibility?

Feb 22 '07 #1
1 2037
Hi,

There is no way to know the exact time left, but there are ways to simulate it.
1) Keep track of the starting time and the total number of files to copy.
2) After each copied file, find out the average time of total files copied
3) Using the average time, multiply by number of files left to copy
4) Display the calculate the estimated end time and display it in a Label or similar
5) Call Application.DoEvents() to force a GUI update.

A better estimate would be found with total number of bytes copied and total number of bytes left.

An event better estimate would be to scrap CopyTo and handle your own copying using a Stream. This way lets you update the time in the middle of copying a single file.

Also consider putting the copying part in its own Thread to keep the GUI responsive.

Good Luck!
On Thu, 22 Feb 2007 17:17:16 +0100, <sc**********@t-online.dewrote:
Hi,

i use the CopyTo - Function to copy large files into a net drive. Now
it would be mad, if I could indicate the remaining time or also the
status (in %) to the copying action. Have unfortunately still nothing
found... Is there a possibility?



--
Happy coding!
Morten Wennevik [C# MVP]
Feb 22 '07 #2

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

Similar topics

3
by: Stefan Turalski \(stic\) | last post by:
Hi, I used to use CopyTo() method from FileInfo class, does anyone know if there is a way to bind this with progressbar, or with some sort of paintBox - to show progress of moving/coping file ?...
3
by: | last post by:
I have a collectiond derived from NameObjectCollectionBase. FxCop is complaining that I need to implement a strongly typed CopyTo(MyObjectType, int) How do I do this? I can't seem to find any...
2
by: John Bowman | last post by:
Hi All, ..NET 1.1... I'm wondering if there is any approach more convenient to get a list of FileInfo objects than the following. For example, if I wanted to get 1 list of all the Exe's and all...
10
by: Michael Murphy | last post by:
Hi, I have a Windows VB.Net app in which I need to keep files in one folder in sync with files in another folder. I have pasted the code below. Can anyone tell me why I end up with a folder with all...
3
by: pengbsam | last post by:
Hello All: Having a problem with arraylist.copyto function. And here's a sample of my code in C#: In global--> public struct point { int x; string y; }
2
by: pengbsam | last post by:
Hello All: Having a problem with arraylist.copyto function. And here's a sample of my code: In global--> public struct point { int x; string y; } static public point point;
6
by: KWienhold | last post by:
I'm currently working on a project in C# (VS 2003 SP1, .Net 1.1) that utilizes IStream/IStorage COM-Elements. Up to now I have gotten everything to work to my satisfaction, but now I have come...
0
by: dolphinearth | last post by:
Hi. I have a strange problem around DirectoryInfo and FileInfo of C# (c- sharp). I have a File Watcher which automattically imports files from a network drive to a directory on the local...
2
by: =?Utf-8?B?Sm9uIEphY29icw==?= | last post by:
In VB I use FileInfo.CopyTo and get an error when the destination file already exists. What do I use to copy to a destination and write over the existing file? Thanks, Jon
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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
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.