0

I downloaded ftp.dll and I'm using it. I used that code :

ftp.DownloadFiles(Properties.Settings.Default.update_ver,
Application.StartupPath,
new RemoteSearchOptions("*.*", true));

But I want use progress bar which shows progress of download.

There is link for download : http://www.limilabs.com/ftp

Thanks for helps.

PhatBuck
  • 326
  • 5
  • 15

1 Answers1

0

I believe that I have solved your problem. Here are a few steps to fix it:

STEP 1: Add Background Worker.

STEP 2: Set WorkerReportsProgress to True at Properties.

STEP 3: Add backgroundWorker1.RunWorkerAsync(); to form load.

STEP 4: Double Click Background Worker

STEP 5: Add your codes here... Add this code to end of your code :

for (int i = 0; i <= 100; i++)
{
     backgroundWorker1.ReportProgress(i);
     // You can remove Sleeep. I added because my download is realy fast.
     System.Threading.Thread.Sleep(20);
}

STEP 6: Click Events at Properties.

STEP 7: Double click Progress Changed

STEP 8: Add Statusbar1.Value = e.ProgressPercentage;

STEP 9: Double click RunWorkerCompleted

STEP 10: Add your code for finished downloaded.

I hope this will help to everyone.

Nathan
  • 1,135
  • 2
  • 12
  • 27