473,473 Members | 2,025 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

using WinZip32 in C#

38 New Member
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
Apr 8 '08 #1
5 6109
Nilam2477
38 New Member
The command line prompt for running winzip. The below command zips "1.txt" file into "zippy.zip"
C:\Program Files\WinZip>winzip32.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.Diagnostics.Process.Start("C:\\Program 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.Diagnostics.Process.Start("C:\\Program 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
Apr 8 '08 #2
balame2004
142 New Member
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
Hi,

.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.com/tutorial190_Zipping-files-using-GZipStream.html

http://www.geekpedia.com/tutorial191_Unzipping-compressed-files-using-GZipStream.html

Regards,
Balaji U
Apr 8 '08 #3
Plater
7,872 Recognized Expert Expert
I have merged the two threads. Please do not double post your questions.

MODERATOR
Apr 8 '08 #4
Nilam2477
38 New Member
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?
Apr 9 '08 #5
Plater
7,872 Recognized Expert Expert
I have not had troubles using winzip to unzip archives made by GZipStream.
Apr 9 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: rawCoder | last post by:
Hi All, I have a *.cer file, a public key of some one and I want to encrypt some thing using this public key. Can someone point me to a sample code for Encrypting some file using...
1
by: Mike | last post by:
When trying to compile (using Visual Web Developer 2005 Express Beta; frameworkv2.0.50215 ) the source code below I get errors (listed below due to the use of ICallBackEventHandler. Ultimately I...
10
by: Christopher Benson-Manica | last post by:
Why can't I use a class destructor in a using declaration: using MyClass::~MyClass; ? -- Christopher Benson-Manica | I *should* know what I'm talking about - if I ataru(at)cyberspace.org ...
17
by: beliavsky | last post by:
Many of my C++ programs have the line using namespace std; but the "Accelerated C++" book of Koenig and Moo has many examples where the library names are included one at a time, for example ...
8
by: Petter Reinholdtsen | last post by:
I ran into a problem on HP-UX 11.00 the other day, where it refused to compile a program using 'using namespace std;' at the top. The reason seem to be that the compiler refuses to accept 'using...
14
by: john.burton.email | last post by:
I've done some extensive searching and can't seem to find an answer to this - Is it correct to using "using" with templates, for example: using std::vector; Or do I need to specify the type...
3
by: JDeats | last post by:
I have some .NET 1.1 code that utilizes this technique for encrypting and decrypting a file. http://support.microsoft.com/kb/307010 In .NET 2.0 this approach is not fully supported (a .NET 2.0...
3
by: learningvbnet | last post by:
Hi, I am trying to extract zipped files using Winzip in my VB.net application and I ran into 2 stone walls. 1. How do you handle file names with spaces. See psiProcess.Arguments For...
0
by: yugho | last post by:
I'm sorry if I post Winzip question here, but I met a problem. I was running Winzip command by using process in VB.Net, but I had error that I don't know how to trace. 1. I create a batch file:...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.