I am processing some xml files in for loop and according to the number of files has been processed I want to show the progress bar.
Suppose there are 100 files in directory and files are processing one by one in loop and I want to update the progress bar according to the current count of the for loop.
Please suggest..
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
Process the 100 files using a Background Worker, call ReportProgress every iteration, hook on to the Process changed event of the backgroundworker and update a progressbar accordingly.
You can check out this tutorial for details.
You should use BackgroundWorker combined with a ProgressBar control. Here is a simple example.
Take a look at
BackgroundWorker
class, particularly, atProgressChanged
event.