Olá, então é o seguinte eu tenho uma função que faz o download do ficheiro desejado a partir do http, e à medida que ele vai descarregando, vai atualizando a barra de progresso (sendo aumentado de 0% pouco a pouco até 100% quando terminado).
System.IO.Directory.CreateDirectory(@"C:\...\Img");
// Creates a webclient
System.Net.WebClient webClient = new System.Net.WebClient();
// Uses the Event Handler to check whether the download is complete
webClient.DownloadFileCompleted += new System.ComponentModel.AsyncCompletedEventHandler(Completed);
// Uses the Event Handler to check for progress made
webClient.DownloadProgressChanged += new System.Net.DownloadProgressChangedEventHandler(DownloadProgressChanged);
// Defines the URL and destination directory for the downloaded file
webClient.DownloadFileAsync(new Uri("http://link.../google2.0.0.jpg"), @"C:\...\Img\google2.0.0.jpg");
Mas eu precisava que fizesse downloads a partir do ftp e quando eu adiciono as seguintes linhas, ele não atualiza a barra de progresso à medida que vai fazendo o download, sendo só atualizada quando acaba (muda do 0% para 100%)
webClient.Credentials = new System.Net.NetworkCredential(ftpUserID , ftpUserPassword);
webClient.DownloadFileAsync(new Uri("ftp://x.x.x.x@x.x.x.x.com/.../file.extension"), @"C:\...\Img\file.extension");
Se alguém souber como ajudar a resolver, agradecia.