How to unzip a file ?

  • Thread starter Thread starter fniles
  • Start date Start date
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.
 
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/OpenSource/SharpZipLib/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
 
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 ?
 
Thank you.
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 :)
 
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
 
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/library/system.io.compression.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
 
fniles said:
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.
 
Sorry, I just installed VS.NET 2005.


Herfried K. Wagner said:
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.
 
Back
Top