protected virtual void OnDownloadProgressChanged(HttpDownloadProgressChangedEventArgs e) { if (DownloadProgressChanged != null) { DownloadProgressChanged(this, e); } }
/// <summary> /// 处理DownloadProgressChanged事件. /// </summary> void DownloadProgressChanged(object sender, HttpDownloadProgressChangedEventArgs e) { // 每秒刷新摘要. if (DateTime.Now > lastNotificationTime.AddSeconds(1)) { lbSummary.Text = String.Format("已接收: {0}KB, 总共: {1}KB, 速度: {2}KB/s", e.ReceivedSize / 1024, e.TotalSize / 1024, e.DownloadSpeed / 1024); prgDownload.Value = (int)(e.ReceivedSize * 100 / e.TotalSize); lastNotificationTime = DateTime.Now; } }
protected virtual void OnDownloadProgressChanged(HttpDownloadProgressChangedEventArgs e) { if (DownloadProgressChanged != null) { DownloadProgressChanged(this, e); } }
/// <summary> /// 处理DownloadProgressChanged事件. /// </summary> void DownloadProgressChanged(object sender, HttpDownloadProgressChangedEventArgs e) { // 每秒刷新摘要. if (DateTime.Now > lastNotificationTime.AddSeconds(1)) { lbSummary.Text = String.Format("已接收: {0}KB, 总共: {1}KB, 速度: {2}KB/s", e.ReceivedSize / 1024, e.TotalSize / 1024, e.DownloadSpeed / 1024); prgDownload.Value = (int)(e.ReceivedSize * 100 / e.TotalSize); lastNotificationTime = DateTime.Now; } }