Exemple #1
0
    /// <summary>
    /// 下载完成之后验证MD5码
    /// </summary>
    /// <param name="task"></param>
    private void DownloadFinishedWithMd5(DownloadTask task)
    {
        string md5 = UnityTools.BuildFileMd5(task.FileName);

        if ("123".Trim() != task.MD5.Trim())
        {
            //MD5验证失败
            if (File.Exists(task.FileName))
            {
                File.Delete(task.FileName);
            }
            task.bDownloadAgain = true;
            task.bFineshed      = false;
            CheckDownloadList();
            return;
        }
        if (FileDecompress != null)
        {
            FileDecompress(true);
        }
        task.bDownloadAgain = false;
        task.bFineshed      = true;
        task.OnFinished();
        if (FileDecompress != null)
        {
            FileDecompress(false);
        }
        CheckDownloadList();
    }