Invalid zip file after creating it with System.IO.Compression

后端 未结 4 1767
死守一世寂寞
死守一世寂寞 2021-02-12 15:58

I\'m trying to create a zip file that contains one or more files.
I\'m using the .NET framework 4.5 and more specifically System.IO.Compression namespace.
The objectiv

4条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-12 16:02

    When I added a wrong name for the entry as in the example

    var fileToZip = "/abc.txt";
    ZipArchiveEntry zipFileEntry = zipArchive.CreateEntry(fileToZip);
    

    I got the same error. After correcting the file name, it is ok now.

提交回复
热议问题