基于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             }

 

posted on 2016-07-08 14:25  Joey.ZJ  阅读(156)  评论(0编辑  收藏  举报