Пример #1
0
        /// <summary>
        /// 上传使用。先解压缩,然后copy到指定目录中,然后删除对应的解压缩文件夹
        /// </summary>
        /// <param name="zipfilePath">压缩文件目录</param>
        /// <returns></returns>
        public static bool UnZipOperation(string zipfilePath)
        {
            string unzipFilePath = GetZipFileToDirPath();

            CompressHelper.UnZip(zipfilePath, unzipFilePath);
            List <string> files = DirectoryHelper.GetAllFiles(unzipFilePath);

            foreach (string file in files)
            {
                FileHelper.CopyTo(file, Common.SignnameImgUpFile());
            }
            DirectoryHelper.RemoveDirectory(unzipFilePath);
            return(true);
        }
Пример #2
0
        private bool ZipFileOperation(string fileName, string md5, string filePathAll)
        {
            string newZipFilePath = FileHelper.CopyTo(filePathAll);

            if (md5 == Common.Md5(newZipFilePath))
            {
                if (Operation.UnZipOperation(newZipFilePath))
                {
                    DBLogger.Insert(DBLogger.GetLoggerInfo(fileName, "上传的签名zip文件解压缩成功", 1));
                    return(true);
                }
                DBLogger.Insert(DBLogger.GetLoggerInfo(fileName, "上传的签名zip文件解压缩失败", 0));
                return(false);
            }
            else
            {
                DBLogger.Insert(DBLogger.GetLoggerInfo(fileName, "上传的签名zip文件验证不正确", 0));
                return(false);
            }
        }