Are there any good tutorials or any "tricks" to, for instance" make a progress bar give an accurate representation of conecting to and retrieving data from remote database?


In my app I am doing some file readin and remote database connections. Basicaly here is how it works in pesudocode.

  • *Open Folder

    *Read all .env (realy dbase files with different extensions) files and get a list of the ones that are newer than the last time I checked.

    *Open each .env file and read it and determine what other files are associated with it.

    *Open the associated files and get all the contents I need

    *Post all of that content to my remote database

    * close file

    * Move on to next file and repeat


This happens every so many minutes (as chosen by the user) and there are always new files in the folder (could be 1 to 50, or more if it is the first time the program is running)

As you can see, that could be pretty processor and time intensive and I would like to provide the user with some feedback as to how long it is going o take and how far along in the process it is.

Is there an accurate way to show the whole of this progress using a progress bar? Since there are a couple differetn kinds of operations involved (i.e. counting files, opening files and reading them, assembly the info, posting to a database and accounting for delay times with the net) it seems like it would be hard to get a single overall progress.

But if anyone has any input I would love it!

Thanks!