474,047 Members | 2,893 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to unzip a file ?

In VB.NET 2003 how can you programmaticall y unzip a ZIP file ?
Thank you.
Apr 3 '07
13 11530
I would warn you again that you have said twice in this thread that you are
using VS2003.

DotNet 2.0 will not be accessible from VS2003.

However If I have misunderstood then the following may still apply...

I have had VS2005 for about a week andtherefore the following information
may be inacurate but it should point you in the right direction
I would like to use the .NET 2.0 System.IO.Compr ession.
From the MSDN website at
http://msdn2.microsoft.com/en-us/lib...ession.gzipstr
eam(vs.80).aspx
the example shows how to compress then decompress a file.
When decompressing, it is not clear from the example how can I pass
the file
name to GZipStream ? The example passes "ms" (a memorystream) to
GZIPStream,
not a file name. How can I pass the file name to GZIPStream ?
In the example, there is no compressed File.

The Original File is taken and compressed in memory to a stream of bytes.

This stream of bytes could then be written to a file but this is not always
the required functionality. Hence it is not demonstrated.
The bytes are then fed back to the decompression part of the routine and
then the decompressed Bytes are compared with the original bytes that were
read from the file.

If you need to work with Files then all you need to do is to take the appropriate
stream of bytes and write it to a further Filestream. this filestream needs
to have been open for writing.

Alternatively you could use my.Computer.Fil eSystem.WriteAl lBytes

--
Rory
Apr 4 '07 #11
"fniles" <fn****@pfmail. comschrieb:
I would like to use the .NET 2.0 System.IO.Compr ession.
I thought you are using VS.NET 2003. Note that VS.NET 2003 is tied to .NET
1.1 and cannot be used together with .NET 2.0.

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

Apr 4 '07 #12
Sorry, I just installed VS.NET 2005.
"Herfried K. Wagner [MVP]" <hi************ ***@gmx.atwrote in message
news:Oj******** ********@TK2MSF TNGP02.phx.gbl. ..
"fniles" <fn****@pfmail. comschrieb:
>I would like to use the .NET 2.0 System.IO.Compr ession.

I thought you are using VS.NET 2003. Note that VS.NET 2003 is tied to
.NET 1.1 and cannot be used together with .NET 2.0.

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

Apr 4 '07 #13
In that case, take a look at
http://msdn.microsoft.com/msdnmag/is...ipCompression/ for
information on using the J# libraries to zip and unzip files in C#. VB is a
realitively easy port.

Mike Ober.
"fniles" <fn****@pfmail. comwrote in message
news:%2******** **********@TK2M SFTNGP03.phx.gb l...
Sorry, I just installed VS.NET 2005.
"Herfried K. Wagner [MVP]" <hi************ ***@gmx.atwrote in message
news:Oj******** ********@TK2MSF TNGP02.phx.gbl. ..
>"fniles" <fn****@pfmail. comschrieb:
>>I would like to use the .NET 2.0 System.IO.Compr ession.

I thought you are using VS.NET 2003. Note that VS.NET 2003 is tied to
.NET 1.1 and cannot be used together with .NET 2.0.

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


Apr 4 '07 #14

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

Similar topics

7
3401
by: Chris | last post by:
Hi Where can I find info on unzipping file with VB.NET. I need to unzip a winzip file with my application Thanks
10
4547
by: Yogi_Bear_79 | last post by:
pardon my ignorance as I am a self-taught hobbyist programmer. I am curious after reading up on SharpZipLib. Can I embed a zipped txt file in my program? Then either read from within the zip file or unzip and read it? I currently have an embedded text file that contains a list that is read into an array. I'm always looking to save space. And I could reduce my file size 75% if it was zipped! I have looked at the SharpZipLib web site,...
1
2518
by: johnnyh | last post by:
I am currently using ASP.Net / C# to partially upload the first 100K of a CSV file to programattically extract the header information for field mapping against our database and for a test sample of records to check some validation before entire file is uploaded. (Files can be HUGE) Question - what about when the file is Zipped? Can I still upload the first 100K of the file and somehow unzip that portion of the file? Or
1
1869
by: Jean Christophe Avard | last post by:
Hi! Finally I figure out what was wrong... "objZipEntry.size = strmFile" I wasn't giving the right file length... But now, I have issue with the unzip function... I can't unzip it, the unzip function return true but its invalid parameter when I try to set the image to the picture box.... Private Overloads Function Unzip(ByVal strSource As String, ByVal strFileToExtract As String, ByRef newms As MemoryStream) As Boolean If...
3
5795
by: SDRoy | last post by:
Hello Can someone tell me how I can unzip a .zip file in C#. The zip file is already there and I just need to unzip..not zip and unzip. -- Thanks, SDRoy
4
6045
by: DataSmash | last post by:
I need to unzip all zip file(s) in the current directory into their own subdirectories. The zip file name(s) always start with the string "usa" and end with ".zip". The code below will make the subdirectory, move the zip file into the subdirectory, but unzips the contents into the root (current) directory. I want the contents of the zip file unloaded into the newly created subdirectory where the zip file is. Any ideas? Thanks.
3
2646
by: sdoty044 | last post by:
I am a true n00b... and I just using Python to complete some very small uneventful task, but need help with one last thing. Basically, this I what I am trying to do. make a temp directory (this part I can do) Need help with: ***unzip a JAR file with the complete list of subdirectories w/ files****
5
7053
by: =?Utf-8?B?anVsaW8=?= | last post by:
Hi, I write a program to unzip a Tar file generated on a Unix environment file using SharpZipLib, but returns a error "Header checksum is invalid" when execute the program. This error appears when I try to extract the files. Can any help me where is a sample to unzip a tar file TIA Julio
1
8584
by: olddocks | last post by:
I want to upload a zip file and then extract/unzip it. I am accomplishing this with php exec command. I am calling unzip from php exec command within a php script and it is not extracting files. why? <?php echo exec('unzip file.zip'); ?> i checked apache logs and it says It works perfectly fine when i unzip using SSH command line.. how to fix this problem.
2
6426
by: somsub | last post by:
Hi all, Here is my samle code use strict ; use warnings ; use IO::Uncompress::Unzip ; When I compiled this three lines of code in win32 I got error like below.
0
12152
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
11607
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
12042
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10320
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8706
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7878
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6665
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
4950
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3980
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.