473,839 Members | 1,674 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 #1
13 11509
In VB.NET 2003 how can you programmaticall y 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.Sha rpZipLib.dll in the Reference of my
VB.Net project, I got an error : "A reference to
c:\download\zip \ICSharpCode.Sh arpZipLib.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********@new sgroup.nospamwr ote in message
news:b0******** *************** **@msnews.micro soft.com...
>In VB.NET 2003 how can you programmaticall y 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.Sha rpZipLib.dll in the Reference
of my VB.Net project, I got an error : "A reference to
c:\download\zip \ICSharpCode.Sh arpZipLib.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.Sha rpZipLib.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********@new sgroup.nospamwr ote in message
news:b0******** *************** **@msnews.micro soft.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.b at ?
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.Sha rpZipLib.dll in the Reference
of my VB.Net project, I got an error : "A reference to
c:\download\zi p\ICSharpCode.S harpZipLib.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.Sha rpZipLib.dll into the
same directory where my VB.Net project is ?
Well I have a Dir Structure like the following

Integration
Integration\3rd Party
Integration\Sol ution1
Integration\Sol ution1\Project1
Integration\Sol ution1\Project2
Integration\Sol ution1\Project3
Integration\Sol ution1\Release
Integration\Sol ution2
Integration\Sol ution2\Project1
Integration\Sol ution2\Project2
Integration\Sol ution2\Project3
Integration\Sol ution2\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.Comp ression'
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.Sha rpZipLib.dll in the Reference of my
VB.Net project, I got an error : "A reference to
c:\download\zip \ICSharpCode.Sh arpZipLib.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 programmaticall y 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.Compr ession.
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********@new sgroup.nospamwr ote in message
news:b0******** *************** **@msnews.micro soft.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.Sha rpZipLib.dll into the
same directory where my VB.Net project is ?

Well I have a Dir Structure like the following
Integration
Integration\3rd Party
Integration\Sol ution1
Integration\Sol ution1\Project1
Integration\Sol ution1\Project2
Integration\Sol ution1\Project3
Integration\Sol ution1\Release
Integration\Sol ution2
Integration\Sol ution2\Project1
Integration\Sol ution2\Project2
Integration\Sol ution2\Project3
Integration\Sol ution2\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.Comp ression' NameSpace

I hope this helps :)

--
Rory


Apr 4 '07 #9
Thank you.

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...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******** ******@TK2MSFTN GP03.phx.gbl...
"fniles" <fn****@pfmail. comschrieb:
>In VB.NET 2003 how can you programmaticall y 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

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

Similar topics

7
3382
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
4526
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
2510
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
1860
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
5787
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
6031
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
2635
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
7044
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
8542
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
6400
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
9856
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9698
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10910
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...
1
7833
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
7021
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
5683
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...
0
5867
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4493
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 we have to send another system
3
3136
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.