SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

I need help with ZIP component!

Last post 07-02-2008 5:45 PM by vbjay. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 07-01-2008 3:22 PM

    I need help with ZIP component!

    Hello I have a question, please help me!

    This assembly works great, I use it in VB.NET and have no problem adding file to zip archives.

    But I have problems with extracting files from the archive!

    Dim MyZip As New ZipInputStream(File.OpenRead(FileTextBox.Text))
    Dim EntryObject As ZipEntry = MyZip.GetNextEntry()
    While IsNothing(EntryObject) = False
        If EntryObject.IsFile And EntryObject.Name = "myfile.txt" Then

            'I don't know how to extacr each EntryObject here!!!

        End If
        EntryObject = MyZip.GetNextEntry()
    End While
    MyZip.Close()

  • 07-01-2008 6:45 PM In reply to

    • vbjay
    • Top 500 Contributor
    • Joined on 06-30-2008
    • Posts 6

    Re: I need help with ZIP component!

     Take a look at the code for fastzip.  That can give you a starting point to understand how to extract files.  You can use it to do it quick and dirty or look at the code and see how it is done and write the code yourself.

    fastzip.cs in the source for #ziplib

  • 07-02-2008 4:50 PM In reply to

    Re: I need help with ZIP component!

    Hello and thanks. Do you know why I cannot use wild chars here? FastZIP.ExtractZip(RestoreTextBox.Text, "C:\", "*.txt") I want to only extract .txt files OR all files except .bat files, do you think it's possible?!
  • 07-02-2008 5:45 PM In reply to

    • vbjay
    • Top 500 Contributor
    • Joined on 06-30-2008
    • Posts 6

    Re: I need help with ZIP component!

     Because it uses regular expressions

     

    NameFilter is a string matching class which allows for both positive and negative matching. A filter is a sequence of independant Regex separated by semi-colons ';' Each expression can be prefixed by a plus '+' sign or a minus '-' sign to denote the expression is intended to include or exclude names. If neither a plus or minus sign is found include is the default A given name is tested for inclusion before checking exclusions. Only names matching an include spec and not matching an exclude spec are deemed to match the filter. An empty filter matches any name.

     

Page 1 of 1 (4 items)
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.