标签:def efault arch dir overwrite 文件 list extract extent
using (Stream stream = File.OpenRead(tarPath)) { ReaderOptions o = new ReaderOptions(); var oo = new ArchiveEncoding(); oo.Default = Encoding.Default;// System.Text.Encoding.UTF8; o.ArchiveEncoding = oo; var reader = ReaderFactory.Open(stream, o); while (reader.MoveToNextEntry()) { if (!reader.Entry.IsDirectory) { fileListName.Add(reader.Entry.Key); var op = new ExtractionOptions(); op.Overwrite = true; reader.WriteEntryToDirectory("C:\\", op); } } }
直接贴主要代码,防止伸手党
标签:def efault arch dir overwrite 文件 list extract extent
原文地址:https://www.cnblogs.com/victor-huang/p/9267387.html