如何查找离子zip文件的未压缩大小 [英] How to find uncompressed size of ionic zip file

查看:87
本文介绍了如何查找离子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文件的未压缩大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆