本文介绍了如何查找离子zip文件的未压缩大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个使用 Ionic zip 压缩的zip文件。提取之前,我需要验证可用磁盘空间。但是,我如何事先找到未压缩的尺寸? zip文件中有任何标题信息(通过离子),以便我可以读取吗?
I have a zip file compressed using Ionic zip. Before extracting I need to verify the available disk space. But how do I find the uncompressed size before hand? Is there any header information in the zip file (by ionic) so that I can read it?
推荐答案这应该可以解决问题:
选项1
static long totaluncompressedsize; static string info; foreach (ZipEntry e in zip) { long uncompressedsize = e.UncompressedSize; totaluncompressedsize += uncompressedsize; }或选项2-将需要筛选大量信息
Or option 2 - will need to sift through the mass of info
using (ZipFile zip = ZipFile.Read(zipFile)) { info = zip.Info; }更多推荐
如何查找离子zip文件的未压缩大小
发布评论