提取使用ionic.zip dll创建的zip文件时出现问题

编程入门 行业动态 更新时间:2024-10-28 14:32:37
本文介绍了提取使用ionic.zip dll创建的zip文件时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

大家好, 我正在面对我的zip文件的问题,当我尝试从zipped文件夹打开文件然后它没有打开,但当我尝试打开文件后解压缩文件夹然后打开,它工作正常,请帮我解决问题,这里是我用来拉链Ionic.Zip dll的功能

Hi all, I am facing the issue with my zip file ,when i try to open the file from zipped folder then it does not open ,but when i try to open file after extract the folder and then open ,it works fine ,please help me to resolve the issue,here is the function that i am using to zip with Ionic.Zip dll

private void ExportToZip() { Response.Clear(); //Response.BufferOutput = false; Response.ContentType = "application/zip"; Response.AddHeader("content-disposition", "filename=\"PnLBudgetExport.zip\""); using (ZipFile zip = new ZipFile()) { if (Directory.Exists(Server.MapPath(ZIP_FOLDER))) { foreach (string file in Directory.GetFiles(Server.MapPath(ZIP_FOLDER))) { zip.CompressionMethod = CompressionMethod.None; //int indx = file.LastIndexOf("\\"); //zip.AddEntry(file.Substring(indx), File.ReadAllBytes(file)); zip.AddFile(file, string.Empty); } } zip.Save(Response.OutputStream); } DeleteTempDir(); } where ZIP_FOLDER ="~/ZipExport"

请帮帮我,谢谢提前。

Please help me ,Thanks in advance.

推荐答案

据我所知,您无法访问压缩存档中的(打开)文件。你需要先提取它。 As far as i know, you can't access(open) file in the zipped archive. You need to extract it before.

更多推荐

提取使用ionic.zip dll创建的zip文件时出现问题

本文发布于:2023-11-06 13:12:52,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1563780.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文件   ionic   zip   dll

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!