DCompressData by GZipStream utilty by using System.IO.Compression RRS feed

  • Question

  • Hi ,

          i am trying to unzip the zip file by GZipStream but it is shows error(if Create the Zip file by winzip Software) : The magic number in GZip header is not correct. Make sure you are passing in a GZip stream.

    but if i create the zip file by GZipStream then it is not shows error .

    please how to resolve the error :

    code is :

     string ReadData = "";
                GZipStream instream = new GZipStream(File.OpenRead("D:\\Newproject/"), CompressionMode.Decompress);
                StreamReader reader = new StreamReader(instream);
                ReadData = reader.ReadToEnd();
                txtread.Text = ReadData;


    Thursday, March 7, 2013 12:09 PM


All replies