Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

c# unzip all archive files inside directory

        /// <summary>
        /// Unzip files using Extract to directory method
        /// </summary>
        /// <param name="zipPath">complete path and zipfilename</param>
        /// <param name="extractedPath">extracted files desitnation path</param>
        public static void UnZipToDir(string zipPath, string extractedPath)
        {
            try
            {
                // ZipFile.ExtractToDirectory(zipPath, extractedPath);
                Directory.GetFiles(zipPath, "*.zip", SearchOption.AllDirectories).ToList()
                .ForEach(zipFilePath =>
                {
                    var currentZipPath = Path.Combine(extractedPath, Path.GetFileNameWithoutExtension(zipFilePath));

                    //Inside DLL that will just create the directory if not exist
                    Util_Directory.CreateDirectory(currentZipPath);

                    System.IO.Compression.ZipFile.ExtractToDirectory(zipFilePath, currentZipPath);

                });
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
Comment

PREVIOUS NEXT
Code Example
Csharp :: go down a line in <summary dotnet 
Csharp :: how to store more precise data then float c# 
Csharp :: RGB Arduino uno r3 
Csharp :: how to take previous record in linq c# 
Csharp :: c# Color Convert 
Csharp :: Delegate parameter no return 
Csharp :: if statement to check if a time is between two times c# 
Csharp :: ascx access parent master page 
Csharp :: generate an mvc controller when dotnet core command line 
Csharp :: stack iterator c# 
Csharp :: unity manager.instance 
Csharp :: c# compare 2 binary files 
Csharp :: number to string ef example c# 
Csharp :: get path revit linked unload 
Csharp :: asp.net framework mvc cors error axios 
Csharp :: unity roam, chase, attack states 
Csharp :: get higest number in MVC 
Csharp :: c# for loop Statement 
Csharp :: c# show hidden window wpf 
Csharp :: c# please build the project and retry 
Csharp :: cqrs design pattern .net core 
Csharp :: kendo razor textbox 
Csharp :: C# how to stop user type into combobox 
Csharp :: C# look through object 
Csharp :: c# check if object can be cast to type 
Csharp :: c sharp while statement 
Csharp :: c# validate username and password 
Csharp :: C# today, yesterday, last week, last month 
Csharp :: how to get the size of an array in c# 
Csharp :: unity how to check object position 
ADD CONTENT
Topic
Content
Source link
Name
3+7 =