DownloadProgressChangedEventArgs::TotalBytesToReceive Property
.NET Framework (current version)
Gets the total number of bytes in a WebClient data download operation.
Assembly: System (in System.dll)
To determine the number of bytes already received, use the BytesReceived property.
To determine what percentage of the transfer has occurred, use the ProgressPercentage property.
The following code example shows an implementation of a handler for the DownloadProgressChanged event. The method displays the value of this property.
static void UploadProgressCallback(Object^ sender, UploadProgressChangedEventArgs^ e) { // Displays the operation identifier, and the transfer progress. Console::WriteLine("{0} uploaded {1} of {2} bytes. {3} % complete...", (String ^)e->UserState, e->BytesSent, e->TotalBytesToSend, e->ProgressPercentage); } static void DownloadProgressCallback(Object^ sender, DownloadProgressChangedEventArgs^ e) { // Displays the operation identifier, and the transfer progress. Console::WriteLine("{0} downloaded {1} of {2} bytes. {3} % complete...", (String ^)e->UserState, e->BytesReceived, e->TotalBytesToReceive, e->ProgressPercentage); }
.NET Framework
Available since 2.0
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Available since 2.0
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Show: