473,508 Members | 2,119 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 programmatically unzip a ZIP file ?
Thank you.
Apr 3 '07 #1
13 11472
In VB.NET 2003 how can you programmatically unzip a ZIP file ? Thank
you.
You'll need a third party component or library.

We use SharpZipLib available from http://www.icsharpcode.net/OpenSource/SharpZipLib/

More commercial components exist. I believe Xceed do one.

--
Rory
Apr 3 '07 #2
Thank you.

1. I program in VB.Net 2003, can I use SharpZipLib ?

2. I downloaded both the NET 2.0: Compiled assembly with documentation and
install scripts and Source code and samples. To install it, do I run the
installGAC.bat ?
Do I need to create a sub-folder called BIN before I run this bat file ?
Even after creating the BIN folder, when I run this bat file from the
command prompt, I got the error "Failur adding assembly to the cache: The
system cannot find the file specified". How can I fix this ?

3. When I try to include ICSharpCode.SharpZipLib.dll in the Reference of my
VB.Net project, I got an error : "A reference to
c:\download\zip\ICSharpCode.SharpZipLib.dll could not be added. This is not
a valid assembly or COM component. Only assemblies with extension 'dll' and
COM components can be referenced. Please make sure that the file is
accessible, and that it is a valid assembly or COM component.

Thank you.

"Rory Becker" <Ro********@newsgroup.nospamwrote in message
news:b0*************************@msnews.microsoft. com...
>In VB.NET 2003 how can you programmatically unzip a ZIP file ? Thank
you.

You'll need a third party component or library.

We use SharpZipLib available from
http://www.icsharpcode.net/OpenSource/SharpZipLib/

More commercial components exist. I believe Xceed do one.

--
Rory


Apr 3 '07 #3
Thank you.
>
1. I program in VB.Net 2003, can I use SharpZipLib ?
Yup but you will need to use the Framework V1.1 version

Both versions are available here http://www.icsharpcode.net/OpenSourc.../Download.aspx
but you do need the 1.0/1.1 version.
2. I downloaded both the NET 2.0: Compiled assembly with documentation
and
install scripts and Source code and samples. To install it, do I run
the
installGAC.bat ?
Do I need to create a sub-folder called BIN before I run this bat file
?
Even after creating the BIN folder, when I run this bat file from the
command prompt, I got the error "Failur adding assembly to the cache:
The
system cannot find the file specified". How can I fix this ?
I don't think I can help you here. I don't use it it the GAC, prefering to
use XCopy deployment and just lumping the dll into my own dir alongside my
exe.
3. When I try to include ICSharpCode.SharpZipLib.dll in the Reference
of my VB.Net project, I got an error : "A reference to
c:\download\zip\ICSharpCode.SharpZipLib.dll could not be added. This
is not a valid assembly or COM component. Only assemblies with
extension 'dll' and COM components can be referenced. Please make sure
that the file is accessible, and that it is a valid assembly or COM
component.
Again I think this is down to using the .Net 2.0 version when you can only
code with .Net 1.1 assemblies and code in VS2003

I hope this helps

--
Rory
Apr 3 '07 #4
Thank you.
>I don't use it it the GAC, prefering to use XCopy deployment and just
lumping the dll into my own dir alongside my exe.
Did you mean to just copy the ICSharpCode.SharpZipLib.dll into the same
directory where my VB.Net project is ?

Is there any ZIP library or component that I can use with Framework 2.0 ?

"Rory Becker" <Ro********@newsgroup.nospamwrote in message
news:b0*************************@msnews.microsoft. com...
>Thank you.

1. I program in VB.Net 2003, can I use SharpZipLib ?

Yup but you will need to use the Framework V1.1 version

Both versions are available here
http://www.icsharpcode.net/OpenSourc.../Download.aspx but you do
need the 1.0/1.1 version.
>2. I downloaded both the NET 2.0: Compiled assembly with documentation
and
install scripts and Source code and samples. To install it, do I run
the
installGAC.bat ?
Do I need to create a sub-folder called BIN before I run this bat file
?
Even after creating the BIN folder, when I run this bat file from the
command prompt, I got the error "Failur adding assembly to the cache:
The
system cannot find the file specified". How can I fix this ?

I don't think I can help you here. I don't use it it the GAC, prefering to
use XCopy deployment and just lumping the dll into my own dir alongside my
exe.
>3. When I try to include ICSharpCode.SharpZipLib.dll in the Reference
of my VB.Net project, I got an error : "A reference to
c:\download\zip\ICSharpCode.SharpZipLib.dll could not be added. This
is not a valid assembly or COM component. Only assemblies with
extension 'dll' and COM components can be referenced. Please make sure
that the file is accessible, and that it is a valid assembly or COM
component.

Again I think this is down to using the .Net 2.0 version when you can only
code with .Net 1.1 assemblies and code in VS2003

I hope this helps

--
Rory


Apr 3 '07 #5
Thank you.
>
>I don't use it it the GAC, prefering to use XCopy deployment and just
lumping the dll into my own dir alongside my exe.
Did you mean to just copy the ICSharpCode.SharpZipLib.dll into the
same directory where my VB.Net project is ?
Well I have a Dir Structure like the following

Integration
Integration\3rdParty
Integration\Solution1
Integration\Solution1\Project1
Integration\Solution1\Project2
Integration\Solution1\Project3
Integration\Solution1\Release
Integration\Solution2
Integration\Solution2\Project1
Integration\Solution2\Project2
Integration\Solution2\Project3
Integration\Solution2\Release

So that I can reference 3rdParty Dlls from somewhere under 3rdParty from
any of my projects in any of my solutions
Then I set copyLocal to true (in most cases) which ends up with the dll being
copied by vs into the bin dir alongside the generated exe.
>
Is there any ZIP library or component that I can use with Framework
2.0 ?
A couple of points....

1.You said you were using VS2003. This will not allow you to use or link
to dotnet 2.0 code/assemblies
2.If you do upgrade to VS2005...
2a....you can use the same .Net 1.1 libraries as they are (largely) forward
compatible.
2b....you can use the SharpZipLib .Net 2.0 version available from the same
site
3....I'm sure xceed do versions of their Zip software for all the framework
versions
4....Net 2.0 comes with some build in zip classes. Check out the 'System.IO.Compression'
NameSpace

I hope this helps :)

--
Rory
Apr 3 '07 #6
On Tue, 3 Apr 2007 15:08:54 -0500, fniles wrote:
Thank you.

1. I program in VB.Net 2003, can I use SharpZipLib ?

2. I downloaded both the NET 2.0: Compiled assembly with documentation and
install scripts and Source code and samples. To install it, do I run the
installGAC.bat ?
Do I need to create a sub-folder called BIN before I run this bat file ?
Even after creating the BIN folder, when I run this bat file from the
command prompt, I got the error "Failur adding assembly to the cache: The
system cannot find the file specified". How can I fix this ?

3. When I try to include ICSharpCode.SharpZipLib.dll in the Reference of my
VB.Net project, I got an error : "A reference to
c:\download\zip\ICSharpCode.SharpZipLib.dll could not be added. This is not
a valid assembly or COM component. Only assemblies with extension 'dll' and
COM components can be referenced. Please make sure that the file is
accessible, and that it is a valid assembly or COM component.

Thank you.

There should be a .NET 1.1 version of SharpZipLib for you to use in your
project
--
Bits.Bytes
http://bytes.thinkersroom.com
Apr 3 '07 #7
"fniles" <fn****@pfmail.comschrieb:
In VB.NET 2003 how can you programmatically unzip a ZIP file ?
Compressing files and data
<URL:http://dotnet.mvps.org/dotnet/faqs/?id=compression&lang=en>

--
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 #8
Thank you.

I would like to use the .NET 2.0 System.IO.Compression.
From the MSDN website at
http://msdn2.microsoft.com/en-us/lib...am(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 ?

Thank you.

"Rory Becker" <Ro********@newsgroup.nospamwrote in message
news:b0*************************@msnews.microsoft. com...
>Thank you.
>>I don't use it it the GAC, prefering to use XCopy deployment and just
lumping the dll into my own dir alongside my exe.
Did you mean to just copy the ICSharpCode.SharpZipLib.dll into the
same directory where my VB.Net project is ?

Well I have a Dir Structure like the following
Integration
Integration\3rdParty
Integration\Solution1
Integration\Solution1\Project1
Integration\Solution1\Project2
Integration\Solution1\Project3
Integration\Solution1\Release
Integration\Solution2
Integration\Solution2\Project1
Integration\Solution2\Project2
Integration\Solution2\Project3
Integration\Solution2\Release

So that I can reference 3rdParty Dlls from somewhere under 3rdParty from
any of my projects in any of my solutions
Then I set copyLocal to true (in most cases) which ends up with the dll
being copied by vs into the bin dir alongside the generated exe.
>>
Is there any ZIP library or component that I can use with Framework
2.0 ?

A couple of points....

1.You said you were using VS2003. This will not allow you to use or link
to dotnet 2.0 code/assemblies 2.If you do upgrade to VS2005...
2a....you can use the same .Net 1.1 libraries as they are (largely)
forward compatible.
2b....you can use the SharpZipLib .Net 2.0 version available from the
same site
3....I'm sure xceed do versions of their Zip software for all the
framework versions
4....Net 2.0 comes with some build in zip classes. Check out the
'System.IO.Compression' NameSpace

I hope this helps :)

--
Rory


Apr 4 '07 #9
Thank you.

I would like to use the .NET 2.0 System.IO.Compression.
From the MSDN website at
http://msdn2.microsoft.com/en-us/lib...am(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 ?

Thank you.

"Herfried K. Wagner [MVP]" <hi***************@gmx.atwrote in message
news:O1**************@TK2MSFTNGP03.phx.gbl...
"fniles" <fn****@pfmail.comschrieb:
>In VB.NET 2003 how can you programmatically unzip a ZIP file ?

Compressing files and data
<URL:http://dotnet.mvps.org/dotnet/faqs/?id=compression&lang=en>

--
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 #10
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.Compression.
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.FileSystem.WriteAllBytes

--
Rory
Apr 4 '07 #11
"fniles" <fn****@pfmail.comschrieb:
I would like to use the .NET 2.0 System.IO.Compression.
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****************@TK2MSFTNGP02.phx.gbl...
"fniles" <fn****@pfmail.comschrieb:
>I would like to use the .NET 2.0 System.IO.Compression.

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******************@TK2MSFTNGP03.phx.gbl...
Sorry, I just installed VS.NET 2005.
"Herfried K. Wagner [MVP]" <hi***************@gmx.atwrote in message
news:Oj****************@TK2MSFTNGP02.phx.gbl...
>"fniles" <fn****@pfmail.comschrieb:
>>I would like to use the .NET 2.0 System.IO.Compression.

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
3344
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
4498
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...
1
2460
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...
1
1831
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...
3
5766
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
5989
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...
3
2617
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...
5
7030
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...
1
8491
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?...
2
6349
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
7124
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
7326
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
7385
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...
0
7498
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...
1
5053
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...
0
3195
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
3182
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
766
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
418
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.