Skip to content

Instantly share code, notes, and snippets.

@entriphy
Created April 8, 2017 03:53
Show Gist options
  • Select an option

  • Save entriphy/109b3cacc3bb1085c47a3455b646928b to your computer and use it in GitHub Desktop.

Select an option

Save entriphy/109b3cacc3bb1085c47a3455b646928b to your computer and use it in GitHub Desktop.
public static void ExtractZip(string zipFile, string extractDirectory = "")
{
string zipPath = Path.GetFullPath(zipFile);
string zipName = Path.GetFileName(zipPath);
if (extractDirectory == "")
{
extractDirectory = Path.GetDirectoryName(zipFile) + @"\" + zipName.Replace(".zip", "");
}
ZipFile.ExtractToDirectory(zipPath, extractDirectory);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment