Advertisement
elena1234

ZipAndExtract

Jan 17th, 2021
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.51 KB | None | 0 0
  1. using System;
  2. using System.IO.Compression;
  3.  
  4. namespace ZipAndExtract
  5. {
  6.     class Program
  7.     {
  8.         static void Main(string[] args)
  9.         {
  10.             string startPath = @"F:\C#\ZipFileDemoC#Advanced";
  11.             string zipPath = @"F:\C#\ZipFileDemoCreateZip\result.zip"; // result.zip
  12.             string extractPath = @"F:\C#\ZipFileDemoExtractZip\";
  13.  
  14.             ZipFile.CreateFromDirectory(startPath, zipPath);
  15.             ZipFile.ExtractToDirectory(zipPath, extractPath);      
  16.         }
  17.     }
  18. }
  19.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement