Esempio n. 1
0
        private void timerDownload_Tick(object sender, EventArgs e)
        {
            DownloadProgressBar.Maximum = 100;
            DownloadProgressBar.Minimum = 0;

            int iPos = videoCapture.GetDownloadProgress();

            if ((iPos > DownloadProgressBar.Minimum) && (iPos < DownloadProgressBar.Maximum))
            {
                DownloadProgressBar.Value = iPos;
            }

            if (iPos == 100)  //下载完成
            {
                videoCapture.DownloadStop();
                DownloadProgressBar.Value = 0;
                timerDownload.Enabled     = false;
                button4.Text = "回放下载";
                MessageBox.Show("下载完成!文件已保存至" + sPlayBackFileName1 + ".mp4。");
            }

            if (iPos == 200) //网络异常,下载失败
            {
                MessageBox.Show("The downloading is abnormal for the abnormal network!");
                timerDownload.Stop();
            }
        }