Ejemplo n.º 1
0
 void down_SecondDownLoad(object sender, Utility.DownLoad.SecondDownLoadEventArgs e)
 {
     this.lblFileSize.Text   = "文件总大小:    " + e.fileSize.ToString();
     this.lblAllTime.Text    = "预计总耗时:    " + e.allTime.ToString();
     this.lblDownLoad.Text   = "总下载:    " + e.downLoadSize.ToString();
     this.lblSpeed.Text      = "当前速率:    " + e.speed.ToString();
     this.lblUseTime.Text    = "已耗时:    " + ((int)e.useTime.TotalSeconds).ToString();
     this.progressBar1.Value = Convert.ToInt32(e.downLoadSize * 100 / e.fileSize);
 }
Ejemplo n.º 2
0
 //更新下载时的当前进展状态
 public void OnDownLoad()
 {
     if (SecondDownLoad != null)
     {
         ChangeTime();
         this.speed = (downLoadSizeFlag - BeforSecondDownLoadSize) / 1024;
         BeforSecondDownLoadSize = downLoadSizeFlag;
         long temp = 0;
         if (downLoadSizeFlag != 0)
         {
             temp = this._file.FileSize / downLoadSizeFlag * (long)this.useTime.TotalSeconds * 10000000;
         }
         this.allTime = new TimeSpan(temp);
         SecondDownLoadEventArgs e = new SecondDownLoadEventArgs(downLoadSizeFlag / 1024, useTime, allTime, speed, this._file.FileSize / 1024);
         SecondDownLoad(this, e);
     }
 }
Ejemplo n.º 3
0
 //更新下载时的当前进展状态
 public void OnDownLoad()
 {
     if (SecondDownLoad != null)
     {
         ChangeTime();
         this.speed = (downLoadSizeFlag - BeforSecondDownLoadSize) / 1024;
         BeforSecondDownLoadSize = downLoadSizeFlag;
         long temp = 0;
         if (downLoadSizeFlag != 0)
         {
             temp = this._file.FileSize / downLoadSizeFlag * (long)this.useTime.TotalSeconds * 10000000;
         }
         this.allTime = new TimeSpan(temp);
         SecondDownLoadEventArgs e = new SecondDownLoadEventArgs(downLoadSizeFlag / 1024, useTime, allTime, speed, this._file.FileSize / 1024);
         SecondDownLoad(this, e);
     }
 }