Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private string OpenZipFile(string filePath,out bool isSuccess)
- {
- String ExtractionPath = null;
- isSuccess = true;
- using (ZipArchive ZipArchiveZArchive = System.IO.Compression.ZipFile.OpenRead(filePath))
- {
- //Clear temp folders
- ClearTempFolder();
- try
- {
- //Loop though each element
- foreach (ZipArchiveEntry zaEntry in ZipArchiveZArchive.Entries)
- {
- //Other code
- ////
- if (zaEntry.FullName.EndsWith("PlugIns.zip"))
- {
- try
- {
- string tempPlugIns = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + PgmDataPath + @"PlugIns.zip";
- if (!Directory.Exists(Path.GetDirectoryName(tempPlugIns)))
- {
- Directory.CreateDirectory(Path.GetDirectoryName(tempPlugIns));
- }
- if (File.Exists(tempPlugIns))
- File.Delete(tempPlugIns);
- zaEntry.ExtractToFile(tempPlugIns); //This line is throwing exception
- }
- }
- //Other logic
- }
- }
Add Comment
Please, Sign In to add comment