I am testing some features of WebClient class and I decided to see how DownloadProgressChanged works so I made up such code:
static void Main(string[] args)
{
WebClient client = new WebClient();
client.Proxy = null;
client.BaseAddress = "ftp://ftp.xxxxxxx.com";
CredentialCache cache = new CredentialCache();
NetworkCredential credential = new NetworkCredential("userxxx", "passxxxx");
client.Credentials = credential;
client.DownloadProgressChanged += new DownloadProgressChangedEventHandler(client_DownloadProgressChanged);
Uri remoteFile;
Uri.TryCreate("/public_html/folderxxxx/Pictures/Product/Resized/1.jpg", System.UriKind.Relative, out remoteFile);
client.DownloadFileAsync(remoteFile, "1.jpg");
System.Diagnostics.Process.Start("1.jpg");
Console.ReadLine();
}
static void client_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e)
{
Console.WriteLine(e.ProgressPercentage.ToString());
}
When I run this application, this is what I see as progress:

Looks nothing fancy. Ben Albahari suggest using new Thread instead of using Async method and this event handler is useful when you actually use Async method.
So how can I show Progress truly?
EDIT:
According to MSDN this should be done:
A passive FTP file transfer will always show a progress percentage of
zero, since the server did not send the file size. To show progress,
you can change the FTP connection to active by overriding the
GetWebRequest virtual method:
Sample Code:
internal class MyWebClient:WebClient{
protected override WebRequest GetWebRequest(Uri address) {
FtpWebRequest req = (FtpWebRequest)base.GetWebRequest(address);
req.UsePassive = false;
return req;
}
}
Which is what I did but the same problem happens:

From MSDN:
Source