Search code examples
c#dotnetzip

Extract zip MemoryStream to string


I am using DotNetZip Library to save MemoryStream to .xml data and read its text form saved loacation:

using (ZipFile zip = ZipFile.Read(myMs))
{
   zip[0].Extract(@"C:\XmlFilePath\MyXml.xml", ExtractExistingFileAction.OverwriteSilently);
}

Is there any way to read Xml string on extracting without saving it in file or temp file using this library? Please Help. Thanks.


Solution

  • You should be able to get a stream from zip[0].OpenReader() and read your string from that.