Extracting zip file in memory failing with C# DotNetZip

别来无恙 提交于 2019-12-05 18:04:43

It's difficult to say why your code doesn't work. I would start by simplifying it and ensuring that I am properly disposing all disposable resources such as streams:

class Program
{
    static void Main()
    {
        var url = "http://downloads.sourceforge.net/project/junit/junit/3.8.1/junit3.8.1.zip";
        using (var client = new WebClient())
        using (var zip = ZipFile.Read(client.DownloadData(url)))
        {
            foreach (var entry in zip)
            {
                entry.Extract(".");
            }        
        }
    }
}

Make sure you checkout the documentation for many useful examples of using the DotNetZip library.

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