使用700 GB文件的密码时,Zip进程耗时太长

时间:2015-04-16 14:31:22

标签: c# dotnetzip

我已经使用了以下代码而没有密码选项来获取700 GB文件,而且运行速度非常快(约4小时)。使用7ZIP尝试完全相同的操作大约需要2天。但是,当我添加密码选项时,它只显示正在创建的zip文件的零字节。以下代码是否有任何问题(密码特定)?无论如何,当指定密码时,下面的代码可以运行得更快吗?

string password = "uG9GHi@4";

Console.WriteLine("txtFileInPath 991 :" + txtFileInPath);
Console.WriteLine("zipFileOutPath :" + zipFileOutPath);
Console.WriteLine("Password       :" + password);
Console.WriteLine("running        :" + DateTime.Now);

using (ZipFile zip = new ZipFile())
{                        
    zip.UseZip64WhenSaving = Zip64Option.Always;                
    zip.CompressionLevel = Ionic.Zlib.CompressionLevel.BestCompression;                
    //zip.Password = password;               
    Console.WriteLine("Before AddFile    :" + DateTime.Now);
    zip.AddFile(txtFileInPath, "").Password = password;
    Console.WriteLine("After AddFile    :" + DateTime.Now);

    Console.WriteLine("Before zip.Save    :" + DateTime.Now);
    zip.Save(zipFileOutPath);                
    Console.WriteLine("After zip.Save    :" + DateTime.Now);
}
Console.WriteLine("End              :" + DateTime.Now);

0 个答案:

没有答案