0

I am using the example exactly as defined in the answer here, with the only exception being that I am adding a file extension. That file extension references a file I've placed in the "My Documents" folder (which the example uses for source folder in the file copy process).

        string[] theExtensions = { "*.jpg", "*.jpeg", "*.bmp", "*.png", "*.gif", "*.largefile" };

I've made the file with my new extension 1.8GB in size. When running this code, all the files copy over just fine. The only problem is that the progress bar does not progress at all since adding the new extension and very large file.

The example code is from 2006, so I wonder if there is something in the example that has evolved to handle larger files. Or perhaps there is something with the file extension being larger than 3 characters?

I suspect the issue might be in this part of the example:

    private class UIProgress
    {
        public UIProgress(string name_, long bytes_, long maxbytes_)
        {
            name = name_; bytes = bytes_; maxbytes = maxbytes_;
        }

        public string name;
        public long bytes;
        public long maxbytes;
    }

A second set of eyes is appreciated..

Dshiz
  • 3,099
  • 3
  • 26
  • 53
  • 1
    Looks familiar. That code shows progress by file, not by file size. You need drastically different code, the subject of Stephen Toub's magazine article of Feb 2005. Download it [from here](https://msdn.microsoft.com/en-us/magazine/ee310108.aspx). – Hans Passant Jun 25 '15 at 02:23
  • Your link takes me to all articles for this year. Looking for 2005 articles has a download to a .CHM file that when I search for Toub finds ".NET Matters: File Copy Progress, Custom Thread Pools". A search on that sends me into a loop. Do you happen to have a link that has the content of the article? – Dshiz Jun 25 '15 at 03:29
  • I think this gets me closer: http://stackoverflow.com/questions/6044629/file-copy-with-progress-bar – Dshiz Jun 25 '15 at 20:26
  • I've found Async programming with IProgress and have been working through examples in order to tackle the problems. I have a lot to learn. – Dshiz Jun 27 '15 at 17:44

0 Answers0