How can I unzip a file to a .NET memory stream?

前端 未结 6 597
鱼传尺愫
鱼传尺愫 2020-12-14 00:16

I have files (from 3rd parties) that are being FTP\'d to a directory on our server. I download them and process them even \'x\' minutes. Works great.

Now, some of th

6条回答
  •  北海茫月
    2020-12-14 00:47

    Looks like here is what you need:

    using (var za = ZipFile.OpenRead(path))
    {
        foreach (var entry in sa.Entries)
        {
            using (var r = new StreamReader(entry.Open()))
            {
                //your code here
            }
        }
    }
    

提交回复
热议问题