SFu*_*n28 19 c# .net-4.0 dotnetzip
使用DotNetZip,是否可以压缩文件,使得zip列出文件的文件名不同于磁盘上的文件名?例如,我想将myFile.txt添加到zip文件中,但我希望将其命名为otherFile.txt.
Mar*_*tin 44
来自DotNetZip FAQ:
using (ZipFile zip1 = new ZipFile())
{
zip1.AddFile("myFile.txt").FileName = "otherFile.txt";
zip1.Save(archiveName);
}
Run Code Online (Sandbox Code Playgroud)