Пример #1
0
        private void DownOneFinsihed(object sender, DownLoadArgs args)
        {
            double fileLen = args.FileSize / 1024;
            double useTime = DateTime.Now.Subtract(time).Milliseconds / 1000;

            if (useTime <= 0)
            {
                useTime = 1;
            }
            double netSpeed = fileLen / useTime;

            this.Invoke(new Action(() =>
            {
                //计算瞬时网速
                this.Text = "瞬时速度:" + netSpeed.ToString() + "K/S";

                foreach (var i in downlistCollection)
                {
                    if (args.TaskName == i.Title)
                    {
                        i.ProgressVal++;
                    }
                }
            }));
        }
Пример #2
0
        private void DownAllFinished(object sender, DownLoadArgs args)
        {
            string     caption = args.TaskName + " 下载完成!";
            SqlOperate operate = new SqlOperate();

            operate.CreateOrOpenDataBase("task.db");
            operate.UpdateData("isFinished", "1", args.TaskName);

            this.Invoke(new Action(() =>
            {
                this.Text = caption;
            }));

            operate.CloseDataBase();
            ShowMessage(caption);
        }
Пример #3
0
        private void DownPause(object sender, DownLoadArgs args)
        {
            string caption = args.TaskName + "下载出错";

            ShowMessage(caption);
        }
Пример #4
0
        private void DownAllFinished(object sender, DownLoadArgs args)
        {
            string caption = args.TaskName + "下载完成";

            ShowMessage(caption);
        }