Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Zipping a file programmatically in vs2005

23 views
Skip to first unread message

ReidarT

unread,
Nov 30, 2005, 10:33:36 AM11/30/05
to
How can I zip (compress) a file in vs2005 with windows own zip-program?
reidarT


m.posseth

unread,
Nov 30, 2005, 10:43:09 AM11/30/05
to
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" <rei...@eivon.no> wrote in message
news:eW0F0Nc9...@TK2MSFTNGP12.phx.gbl...

Cor Ligthert [MVP]

unread,
Nov 30, 2005, 11:06:57 AM11/30/05
to
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/downloads/101samples/default.aspx

I hope this helps,

Cor

Herfried K. Wagner [MVP]

unread,
Nov 30, 2005, 11:12:19 AM11/30/05
to
"ReidarT" <rei...@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/>

Jay B. Harlow [MVP - Outlook]

unread,
Nov 30, 2005, 12:46:29 PM11/30/05
to
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]" <hirf-spa...@gmx.at> wrote in message
news:e$RVVjc9F...@TK2MSFTNGP14.phx.gbl...

Ken Tucker [MVP]

unread,
Nov 30, 2005, 6:51:25 PM11/30/05
to
Hi,

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

http://winfx.msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/T_System_IO_Packaging_ZipPackage.asp

Ken
------------------------
"Jay B. Harlow [MVP - Outlook]" <Jay_Har...@tsbradley.net> wrote in
message news:OHl6BYd9...@TK2MSFTNGP14.phx.gbl...

Herfried K. Wagner [MVP]

unread,
Nov 30, 2005, 7:12:45 PM11/30/05
to
"Jay B. Harlow [MVP - Outlook]" <Jay_Har...@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 ;-).

Jay B. Harlow [MVP - Outlook]

unread,
Dec 1, 2005, 11:42:38 AM12/1/05
to
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]" <hirf-spa...@gmx.at> wrote in message

news:e7Wx1vg9...@TK2MSFTNGP12.phx.gbl...

Alexis

unread,
Feb 13, 2006, 4:37:26 PM2/13/06
to
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

m.posseth

unread,
Feb 15, 2006, 2:28:29 PM2/15/06
to

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" <Ale...@discussions.microsoft.com> wrote in message
news:BF13542F-6686-4007...@microsoft.com...

0 new messages