我有一些代码
SevenZipExtractor.SetLibraryPath(@"C:\Program Files\7-Zip\7z.dll");//x64
var cmpr = new SevenZipCompressor();
cmpr.CompressionFinished += (s, e) => { dof.DoFinishEvent(); cmpr = null; };
cmpr.BeginCompressDirectory("C:\\58", "C:\\Table\files\today\58.7z");这段代码是工作的,但当我打开58.7z时,我必须打开所有文件夹(表/文件/今天,然后我看到里面是什么)。也许可以在没有绝对路径的情况下保存?谢谢!
发布于 2014-10-16 02:47:48
根据the source code的说法,有一个布尔标志就是为了这个目的:
/// <summary>
/// Gets or sets the value indicating whether to preserve the directory structure.
/// </summary>
public bool DirectoryStructure { get; set; }发布于 2014-10-16 16:15:14
我找到了解决方案
cmpr.DirectoryStructure = false;https://stackoverflow.com/questions/26389572
复制相似问题