Example #1
0
 /// <summary>
 /// 开始前的准备
 /// </summary>
 private void Prepare(UpdateProgressNotify pFunc)
 {
     CurPro        = 0;
     FirstTime     = true;
     pProgress     = pFunc;
     DownloadSpeed = 0;
     RemoveTmpFile();
 }
Example #2
0
        /// <summary>
        /// 启动
        /// </summary>
        public async Task <double> Start(UpdateProgressNotify pFunc = null)
        {
            Prepare(pFunc);
            string sFilePath = GetTmpFilePath();

            if (sFilePath.IsBlank())
            {
                return(-1);
            }

            await DownloadFileHepler.StartAsync(TEST_URL, sFilePath, null, UpdateDownloadNotify, CompleteDownloadNotify, null, 3);

            RemoveTmpFile();
            return(DownloadSpeed);
        }