Unzip a file in c# using 7z.exe

前端 未结 6 995
被撕碎了的回忆
被撕碎了的回忆 2020-12-12 05:31

I\'m trying to unzip a file from a winform application. I\'m using this code :

string dezarhiverPath = @AppDomain.CurrentDomain.BaseDirectory + \"\\\\7z.exe\         


        
6条回答
  •  星月不相逢
    2020-12-12 06:04

    This maybe can help you.

            //You must create an empty folder to remove.
            string tempDirectoryPath = @"C:\Users\HOPE\Desktop\Test Folder\zipfolder";
            string zipFilePath = @"C:\Users\HOPE\Desktop\7za920.zip";
            Directory.CreateDirectory(tempDirectoryPath);
            ZipFile.ExtractToDirectory(zipFilePath, tempDirectoryPath);
    

提交回复
热议问题