locked
zip files RRS feed

  • Question

  • I need my app to deal with compressed files (any format will work, zip, gzip, rar, ect)

    I need to

    -Take several files, add them to a compressed file, with a non-standard extension, instead of making it something like .zip make it something like .app so the file can be associated with my app.
                                       OR
    Take several files, add them to a compressed file with encryption & user specified password, with a non-standard extension, instead of making it something like .zip make it something like .app so the file can be associated with my app.

    -Attempt to extract the files to a temp directory for use as if they weren't encrypted, if it works then its done, if not my app will need to know then it can prompt the user for the pass to get to the file.  Then attempt to decrypt and open the file with the user defined pass, if it works then fine, if not display an error.

    Any suggestion?

    Saturday, January 27, 2007 11:13 PM

Answers

All replies

  • SharpZipLib
    Sunday, January 28, 2007 12:17 AM
  • THESE ARE THE VB FORUMS NOT C#
    Sunday, January 28, 2007 12:55 AM
  • Be cool :)

    SharpZipLib is just a name of the .NET library which is used to work with archives.

    Once again: it is a .NET library. You can add a reference and use it in your VB.NET project as you want (like you do with System.dll, System.Web.dll, etc which are written in C#).

    Doesn't matter which language has been used to write it. Just get an assembly and work with it.

    Sunday, January 28, 2007 1:55 AM
  • dosen't do no good in C# cuz i cannot put it in my app

    dosen't do no good as a dll either cuz i don't need some code from a box, i need some custom written stuff, something like that would be ok if it were in vb and i could modify it for my specific needs

     

    oh and for the record i don't do anything with system.dll or system.web.dll i never even heard of them....stop being dumb and stop assumming

    Sunday, January 28, 2007 3:20 AM
  • View These

    http://msdn2.microsoft.com/en-us/library/system.io.compression.gzipstream.aspx

    http://geekswithblogs.net/podwysocki/archive/2006/06/21/82628.aspx

    There is also the DeflateStream but is should only  be used if the compression / decompression is to be used by your app only.

    System.IO.Compression

    Rgds,

    Martin.

    Monday, January 29, 2007 2:11 AM
  •  

    you (and msdn2) say that System.IO.Compression is supported in CF2...

    But i don't found it ... and i need use Deflate compression in my project :(

    What do you think about ???

    Friday, February 2, 2007 10:01 AM
  • You can do it with DotNetZip.

    Works in VB.  Fully managed library.  Supports password encryption of zip archives.
    Using zip1 As New ZipFile  
        ' the UpdateFile method might more accurately be called "AddOrUpdateFile"  
        zip1.UpdateFile("MyDocuments\Readme.txt""")  
        zip1.UpdateFile("CustomerList.csv""")  
        zip1.Comment = "This zip archive has been created." 
        zip1.Save("Content.app")  
    End Using  
     
    Using zip As ZipFile = ZipFile.Read("Content.app")  
        Dim s1 As String 
        For Each s1 In zip.EntryFilenames  
            If s1.EndsWith(".txt"Then 
                Dim entry as ZipEntry  
                entry = zip(s1)  
                entry.Extract("c:\temp\extracted")  
            End If 
        Next 
    End Using  
     
     
    • Proposed as answer by cheeso Monday, March 9, 2009 4:52 PM
    Monday, March 9, 2009 4:52 PM