/// <summary> /// Zip解压缩byte[]至文件夹 /// </summary> /// <param name="srcByte"></param> /// <param name="destFolder"></param> public static void DecompressToFolder(byte[] srcByte, string destFolder) { AbstractFile memoryFile = new MemoryFile(); //AbstractFile memoryFile = new DiskFile(System.IO.Path.GetTempPath() + "memoryFile.zip"); memoryFile.Create(); using (Stream stream = memoryFile.OpenWrite(true, FileShare.Write)) { stream.Write(srcByte, 0, srcByte.Length); stream.Close(); } // 必须先写MemoryFile再创建ZipArchive ZipArchive archive = CreateZipArchive(memoryFile); AbstractFolder dest = new DiskFolder(destFolder); archive.CopyFilesTo(dest, true, true, null); memoryFile.Delete(); }