C# – WebClient.UploadProgressChanged Event issue

cnetvisual-studio-2008webclient

I am using VSTS 2008 + C# + .Net 3.5 to develop a console application to upload a file to server. I want to show upload progress. I want to use WebClient.UploadProgressChanged Event, but confused about its function — "Occurs when an asynchronous upload operation successfully transfers some or all of the data." My confusion is, when this event will be raised? The word "some or all" is too confusing, does it mean this event will be called each time 1% of file is upload? 10%? Some fixed bytes? Called randomly? Or something else?

http://msdn.microsoft.com/en-us/library/system.net.webclient.uploadprogresschanged.aspx

thanks in advance,
George

Best Answer

It does kind of what it says. Expect many calls to the event for a big file and only 1 or 2 for a small page. The UploadProgressChangedEventArgs contains the relevant information.