当使用dotnetzip时,它不仅压缩c:\users\tintin\this这样的目录
但它也会压缩users/tintin,这是我不想要的。我希望它压缩最后一个文件夹,所以,这和所有的文件在那里。
我使用
AddSelectedFiles("*.*",path,true);可能真的很简单,但我似乎对此视而不见。
发布于 2011-12-19 19:37:31
我假设您使用的是以下内容:
AddDirectory("c:\users\tintin\this");然而,documentation声明:
如果希望条目出现在zip存档本身的包含目录中,则应该调用AddDirectory()重载,该重载允许您显式地指定要在存档中使用的目录路径。
所以试试吧:
AddDirectory("c:\users\tintin\this", "this");发布于 2017-06-22 15:58:26
尝尝这个
zip.AddSelectedFiles(".pdf", "c:\users\tintin\this\", "");https://stackoverflow.com/questions/8560545
复制相似问题