参考学习网址:
https://www.cnblogs.com/Joetao/articles/7089472.html
选择方案:
使用SharpCompress框架
1.下载SharpCompress.dll并引用
2.编写代码:
using SharpCompress.Reader;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TestUnzip
{
class Program
{
static void Main(string[] args)
{
using (Stream stream = File.OpenRead(@"F:\TestUnZip\testUnzip.rar"))
{
var reader = ReaderFactory.Open(stream);
while (reader.MoveToNextEntry())
{
if (!reader.Entry.IsDirectory)
{
Console.WriteLine(reader.Entry.FilePath);
reader.WriteEntryToDirectory(@&#