//DownloadProgressChanged
//DownloadStringCompleted
//OpenReadCompleted
//OpenWriteCompleted
//UploadProgressChanged
//UploadStringCompleted
// WriteStreamClosed
// DownLoadStringAsnc
//OpenReadAsync
//UpLoadStringAsync
//OpenWriteAsync
WebClient client = new WebClient();
if (client.IsBusy)
client.CancelAsync();
client.OpenReadCompleted+=new OpenReadCompletedEventHandler(client_OpenReadCompleted);
client.DownloadProgressChanged += new DownloadProgressChangedEventHandler(client_DownloadProgressChanged);
client.OpenReadAsync(new Uri("path"));
}
private void client_OpenReadCompleted(object sender, OpenReadCompletedEventArgs e)
{
BitmapImage bitmap = new BitmapImage();
bitmap.SetSource(e.Result);
Image1.Source = bitmap;
}
private void client_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e)
{
int percent = e.ProgressPercentage;
long recieve = e.BytesReceived;
long total = e.TotalBytesToReceive;
}