473,508 Members | 2,369 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Zipping a file programmatically in vs2005

How can I zip (compress) a file in vs2005 with windows own zip-program?
reidarT
Nov 30 '05 #1
9 5492
i use the sharpziblib library for zipping purposes ( not yet needed in VS
2005 ) but i guess it is just a mather of a recompile

regards
Michel Posseth
"ReidarT" <re****@eivon.no> wrote in message
news:eW**************@TK2MSFTNGP12.phx.gbl...
How can I zip (compress) a file in vs2005 with windows own zip-program?
reidarT

Nov 30 '05 #2
Reidar,

There is a sample in the 101 samples for VB2005 (Compresion)

Which makes that it is only copy and paste

http://msdn.microsoft.com/vstudio/do...s/default.aspx

I hope this helps,

Cor

Nov 30 '05 #3
"ReidarT" <re****@eivon.no> schrieb:
How can I zip (compress) a file in vs2005 with windows own zip-program?


Check out the 'System.IO.Compression.GzipStream' class.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Nov 30 '05 #4
Herfried,
I have not used GzipStream yet, however I get the impression that it only
compresses a single stream (file) rather then maintain the collection of
files in a zip. Of course I could have the wrong impression of GzipStream

I understand that you need to use some upcoming WinFX API to maintain the
collection of files in a zip.

For example you could use GzipStream to compress WebRequests & WebResponses
"on the fly".

--
Hope this helps
Jay [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:e$**************@TK2MSFTNGP14.phx.gbl...
| "ReidarT" <re****@eivon.no> schrieb:
| > How can I zip (compress) a file in vs2005 with windows own zip-program?
|
| Check out the 'System.IO.Compression.GzipStream' class.
|
| --
| M S Herfried K. Wagner
| M V P <URL:http://dotnet.mvps.org/>
| V B <URL:http://classicvb.org/petition/>
Nov 30 '05 #5
Hi,

They are in the win fx system.io.packing namespace

http://winfx.msdn.microsoft.com/libr...ZipPackage.asp

Ken
------------------------
"Jay B. Harlow [MVP - Outlook]" <Ja************@tsbradley.net> wrote in
message news:OH**************@TK2MSFTNGP14.phx.gbl...
Herfried,
I have not used GzipStream yet, however I get the impression that it only
compresses a single stream (file) rather then maintain the collection of
files in a zip. Of course I could have the wrong impression of GzipStream

I understand that you need to use some upcoming WinFX API to maintain the
collection of files in a zip.

For example you could use GzipStream to compress WebRequests &
WebResponses
"on the fly".

--
Hope this helps
Jay [MVP - Outlook]
.NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:e$**************@TK2MSFTNGP14.phx.gbl...
| "ReidarT" <re****@eivon.no> schrieb:
| > How can I zip (compress) a file in vs2005 with windows own
zip-program?
|
| Check out the 'System.IO.Compression.GzipStream' class.
|
| --
| M S Herfried K. Wagner
| M V P <URL:http://dotnet.mvps.org/>
| V B <URL:http://classicvb.org/petition/>

Dec 1 '05 #6
"Jay B. Harlow [MVP - Outlook]" <Ja************@tsbradley.net> schrieb:
I have not used GzipStream yet, however I get the impression that it only
compresses a single stream (file) rather then maintain the collection of
files in a zip. Of course I could have the wrong impression of GzipStream


That might be true, but the OP was specifically asking for zipping a single
file ;-).

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Dec 1 '05 #7
Herfried,
| That might be true, but the OP was specifically asking for zipping a
single
| file ;-).

Does the OP want a file that uses the ZIP compression algorithm, or does he
want a .ZIP file that contains a single file?

I really don't know. When I hear "zip a file" I think of a .ZIP file that
contains a single file. Not a file that uses the ZIP compression algorithm.

--
Hope this helps
Jay [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:e7**************@TK2MSFTNGP12.phx.gbl...
| "Jay B. Harlow [MVP - Outlook]" <Ja************@tsbradley.net> schrieb:
| > I have not used GzipStream yet, however I get the impression that it
only
| > compresses a single stream (file) rather then maintain the collection of
| > files in a zip. Of course I could have the wrong impression of
GzipStream
|
| That might be true, but the OP was specifically asking for zipping a
single
| file ;-).
|
| --
| M S Herfried K. Wagner
| M V P <URL:http://dotnet.mvps.org/>
| V B <URL:http://classicvb.org/petition/>
|
Dec 1 '05 #8
Hello,

I have the same request. I looked and the Compresion and it is pretty much
what I needed except for I also need to password protect the copmressed file.
How could I do that?
Thanks,
Alexis

"Cor Ligthert [MVP]" wrote:
Reidar,

There is a sample in the 101 samples for VB2005 (Compresion)

Which makes that it is only copy and paste

http://msdn.microsoft.com/vstudio/do...s/default.aspx

I hope this helps,

Cor

Feb 13 '06 #9

I use the Sharpziblib library that has all the options you mention and lots
and lost more

http://www.icsharpcode.net/OpenSource/SharpZipLib/

it comes with full source and examples in VB and C#

regards

Michel Posseth [MCP]
"Alexis" <Al****@discussions.microsoft.com> wrote in message
news:BF**********************************@microsof t.com...
Hello,

I have the same request. I looked and the Compresion and it is pretty much
what I needed except for I also need to password protect the copmressed
file.
How could I do that?
Thanks,
Alexis

"Cor Ligthert [MVP]" wrote:
Reidar,

There is a sample in the 101 samples for VB2005 (Compresion)

Which makes that it is only copy and paste

http://msdn.microsoft.com/vstudio/do...s/default.aspx

I hope this helps,

Cor

Feb 15 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2698
by: Anil | last post by:
Hello, I am using VS2005 Beta2 and I have added a Simple Line-Graph chart to a ReportViewer control. I can click on the chart and alter for example the Minimum and Maximum scale values of the...
0
1153
by: Benjamin Bittner | last post by:
hallo ng, first of all, for the zipping progress i use the ziplib from http://www.icsharpcode.net/OpenSource/SharpZipLib/Default.aspx now to my problem. im trying to build a little application...
3
7063
by: _DS | last post by:
There is an article on MSDN called: "HOW TO: Build a Connection String Programmatically in ADO.NET by Using Visual C# .NET" http://support.microsoft.com/default.aspx?scid=kb;EN-US;310083 The...
6
5019
by: reidarT | last post by:
I will develop a backup routine with local files (zipped) to an internet server via ftp. How do I zip files in Vb.net? reidarT
8
6424
by: ILCSP | last post by:
Hello, I have a complete project in VB.NET (2003) with all the path to the folders where the files being used are. For example I have these variables: ' Setup Directory Paths ImportDir =...
7
1557
by: Dylan Parry | last post by:
Hi folks, I've got a page that outputs XML, but in some cases the size of the page is several MB. So I figured the best way to deal with it is to ZIP the contents of the page and send that to...
4
1401
by: rcoco | last post by:
I've Zipped the file and tried to send it but I made a mistake wrote a wrong server address and now I want to rename. When I try to zip I get the outlook express with the zip file attached to it....
1
1494
by: durumdara | last post by:
Hi! As I experienced in the year 2006, the Python's zip module is not unicode-safe. With the hungarian filenames I got wrong result. I need to convert iso-8859-2 to cp852 chset to get good...
2
3784
by: karen.google | last post by:
I have an SSIS package that I'm converting from DTS (SQLServer 2005), and the ActiveX Script Task (in VBScript) is deprecated, so I'm trying to convert things to Script tasks (in VB .net). I...
0
7223
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
7115
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
7321
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
7377
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
7036
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
4705
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
3191
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...
0
1547
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
414
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.