End of Central Directory record could not be found

后端 未结 10 1855
温柔的废话
温柔的废话 2020-11-29 10:39

I am downloading a zip file using c# program and I get the error

at System.IO.Compression.ZipArchive.ReadEndOfCentralDirectory()
   at System.IO.Compression         


        
10条回答
  •  抹茶落季
    2020-11-29 11:28

    Might be useful to someone else. I dealt with this by adding an exception to my code, which then:

    1. Creates a temporary directory
    2. Extracts the zip archive (normally works)
    3. Renames the original ziparchive to *.bak
    4. Zips and replaces the original archive file with one that works

提交回复
热议问题