using System.IO.Compression;
static string Compress(string path, string destinationPath)
if (System.IO.Directory.Exists(path))
string pathResult = Path.Combine(destinationPath, "backup.zip");
ZipFile.CreateFromDirectory(path, pathResult);
static void ExtractFile(string filePath, string destinationPath, bool deleteOriginal = false)
if (System.IO.File.Exists(filePath))
ZipFile.ExtractToDirectory(filePath, destinationPath);
System.IO.File.Delete(filePath);