//更新前备份文件
        private void BackUpFiles()
        {
            var rootPath = GetAppRootPath();

            _bkZipFilePath = rootPath + Guid.NewGuid().ToString() + ".zip";
            FilesHandler.CompressFiles(_files, rootPath, _bkZipFilePath);
        }
Exemple #2
0
        public string CompressFilesNeedUpdate(FilesNeedUpdate files)
        {
            var rootPath = GetVersionFilesRootPath();
            //List<string> filesTemp = new List<string>();
            //files.Files.ToList().ForEach(f =>
            //{
            //    filesTemp.Add(rootPath + f);
            //});
            //files.Directories.ToList().ForEach(d =>
            //{
            //    filesTemp.AddRange(FilesHandler.GetAllFilesFromDirectory(rootPath + d));
            //});
            //var filesDistinct = filesTemp.Distinct();
            var zipFileName = Guid.NewGuid().ToString() + ".zip";

            //FilesHandler.ZipFiles(filesDistinct, rootPath, System.Web.HttpRuntime.AppDomainAppPath.ToString() + "VersionFile\\" + zipFileName);
            ////ZipFiles(filesDistinct, zipFileName);
            //return zipFileName;
            FilesHandler.CompressFiles(files, rootPath, System.Web.HttpRuntime.AppDomainAppPath.ToString() + "VersionFile\\" + zipFileName);
            return(zipFileName);
        }