我正在使用 Ionic.zip 压缩一堆文件。这是我将这些文件添加到 zip 中的代码。
ZipFile zip = new ZipFile();
foreach (string filepath in listoffile) //5 files
{
zip.AddFile(filepath, "");
}
zip.Save(mypath + "attachment.zip");
当我检查 zip 中的文件数时,它显示 5,但是当我打开 zip 文件时,它里面只有 4 个文件,并且缺少文件名中包含中文字符的文件。我尝试了多次和不同的文件,只有当文件中包含中文字符时才会发生文件丢失。无论如何我可以做些什么来解决这个问题?