public void UnzippingRarFileAndDelete(string pathFile, string fullPath) { try { using (Stream streamReader = new StreamReader(pathFile).BaseStream) { NUnrar.Archive.RarArchive archive = NUnrar.Archive.RarArchive.Open(streamReader); foreach (RarArchiveEntry entity in archive.Entries) { string path = Path.Combine(fullPath, entity.FilePath); entity.WriteToFile(path); } } File.Delete(pathFile); } catch (Exception ex) { throw new Exception(ex.Message.ToString()); } }
/// <summary> /// RarArchive is the first volume of a multi-part archive. If MultipartVolume is true and IsFirstVolume is false then the first volume file must be missing. /// </summary> public static bool IsFirstVolume(this RarArchive archive) { return(archive.Volumes.First().IsFirstVolume); }
internal RarArchiveEntry(RarArchive archive, IEnumerable <RarFilePart> parts) { this.parts = parts.ToList(); Archive = archive; }