基于C/S模式的程序更新解压

主要是利用开源dll----SharpCompress.dll

 1  using (Stream stream = File.OpenRead(exePath + @"\Update.RAR"))
 2             {
 3                 var reader = ReaderFactory.Open(stream);
 4                 while (reader.MoveToNextEntry())
 5                 {
 6                     if (!reader.Entry.IsDirectory)
 7                     {
 8                         //Console.WriteLine(reader.Entry.FilePath);
 9                         reader.WriteEntryToDirectory(exePath, ExtractOptions.ExtractFullPath | ExtractOptions.Overwrite);
10                     }
11                 }
12             }
原文地址:https://www.cnblogs.com/JoeyZJ/p/5653265.html