How to prevent System.IO.Compression.ZipArchive from corrupting XLSX file?

拥有回忆 提交于 2019-12-11 17:12:42

问题


    ZipArchive archive = ZipFile.Open("test.xlsx", ZipArchiveMode.Update);
    archive.Dispose();

This simplest operation turns test.xlsx into corrupted file, so Excel can't open it. Later if I manually extract all files from corrupted test.xlsx and zip them back, file becomes good again for Excel.

I need to do some changes in xlsx from my code by unpacking some XMLs and modifying them. How to stop file corruption by ZipArchive?

来源:https://stackoverflow.com/questions/58433045/how-to-prevent-system-io-compression-ziparchive-from-corrupting-xlsx-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!