//我的代码压缩使用7 zip
if (System.IO.Directory.Exists(targetfolder))
{
try
{
SevenZipCompressor.SetLibraryPath(@Server.MapPath("~/bin/7z.Libs.16.2.1/bin/x64/7z.dll"));
SevenZipCompressor sevenZipCompressor = new SevenZipCompressor();
sevenZipCompressor.CompressionLevel = SevenZip.CompressionLevel.Ultra; // level compress
sevenZipCompressor.CompressionMethod = CompressionMethod.Lzma2; //method compress
sevenZipCompressor.CompressDirectory(sourceCodeFolder, Path.Combine(targetfolder, string.Concat(DateTime.Now.ToString("ddMMyyyy_HHmm") + fldr + ".zip")));
}
catch (Exception se)
{
SevenZipCompressor.SetLibraryPath(@Server.MapPath("~/bin/7z.Libs.16.2.1/bin/x86/7z.dll"));
SevenZipCompressor sevenZipCompressor = new SevenZipCompressor();
sevenZipCompressor.CompressionLevel = SevenZip.CompressionLevel.Ultra; // level compress
sevenZipCompressor.CompressionMethod = CompressionMethod.Lzma2; // method compress
//我的代码出了什么问题? sevenZipCompressor.CompressDirectory(sourceCodeFolder,Path.Combine(targetfolder,string.Concat(DateTime.Now.ToString(“ddMMyyyy_HHmm”)+ fldr +“。zip”)));
}
Directory.Delete(@Server.MapPath("~/Upload/" + fldr), true);
extractfrom = @Server.MapPath("~/Upload/ZIP/" + string.Concat(DateTime.Now.ToString("ddMMyyyy_HHmm")) + fldr + ".zip");
customSQL.ExecQueryString(" UPDATE TBL_PROGRESS_LEGAL_DOKUMEN set FileName = '" + string.Concat(DateTime.Now.ToString("ddMMyyyy_HHmm") + namafile + ".zip"+ "' , [FileSize] = '" + filesize + "' where id_progress_legal_dokumen = '" + id_chekUpload.Text + "'"));
myfeedback._success("File Success Upload");
}
else
{
}
我的问题为什么7zip使压缩7mb只有6mb?
答案 0 :(得分:1)
(大多数)PDF已经过压缩,你可以通过归档获得很多。
Why don't some files compress very much?
Which files does not reduce its size after compression