i need to zip the files/folder. How can i use winzip32.exe in C# code to programatically zip the files or folder. If you could provide some sample code that would be great. Thanks
using WinZip32 in C#
Collapse
X
-
using WinZip32 in C#
The command line prompt for running winzip. The below command zips "1.txt" file into "zippy.zip"
C:\Program Files\WinZip>wi nzip32.exe -min -a D:zippy.zip D:\\1.txt
I want to do this programatically using C# using Process.Start() . I have trouble specifing the parameters for winzip exe. If i give only the exe name as below winzip application opens
System.Diagnost ics.Process.Sta rt("C:\\Progra m Files\\WinZip\\ winzip32.exe");
When i try giving the parameters(file name etc) as below it gives an error at run time "The system cannot find the file specified"
System.Diagnost ics.Process.Sta rt("C:\\Progra m Files\\WinZip\\ winzip32.exe -min -a D:zippy.zip D:\\1.txt");
I'm not sure if there is any problem with double quotes "". How can i specifiy the paramters? Please help -
Originally posted by Nilam2477i need to zip the files/folder. How can i use winzip32.exe in C# code to programatically zip the files or folder. If you could provide some sample code that would be great. Thanks
.NET framework 2.0 introduced a new class entitled GZipStream that allows you to do simple compressing and decompressing actions.
Tutorials for using this class are available at:
http://www.geekpedia.c om/tutorial190_Zip ping-files-using-GZipStream.html
http://www.geekpedia.c om/tutorial191_Unz ipping-compressed-files-using-GZipStream.html
Regards,
Balaji UComment
-
-
I tried to use GZipStream class to compress the files. But when i tried to unzip using WinZip32.exe it dint work. There was an error message "Cannot open file it does not appear to be a valid archive". Does this mean that i cannot using WinZip utility to unzip the files which are compressed using GZipStream. Is there any other alternative?Comment
Comment