Hello...
I have created application (duplicate file detector) and now I have a progress bar and I want synchronize "how many percentage of scan is ready"
Here is my code for scanning:
private void scanFiles(string rootDirectory)
{
try
{
if (stop)
{
return;
}
foreach (string dir in Directory.GetDirectories(rootDirectory))
{
if (stop)
{
return;
}
Application.DoEvents();
if (dir.ToLower().IndexOf("$recycle.bin") == -1)
{
scanFiles(dir);
}
}
foreach (string file in Directory.GetFiles(rootDirectory))
{
if (stop)
{
return;
}
Application.DoEvents();
// Here is Code for comparing...
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
return;
}
}
So... how to set progress bar to show "how many percentage of scan is ready" ?
Thanks...