Results 1 to 5 of 5

Thread: How do I Handle .zip files?

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2011
    Posts
    15

    How do I Handle .zip files?

    I have been working on a program and I need it to unzip a zip file. Can anyone help me? Thank you!

    I tried handling a zip file as a directory but that didn't work.

    It wouldn't hurt if I could compress files into a zip file to! But I need unzipping the file first.

    This is my code handling it as a directory:

    Code:
    Dim count As Integer = Directory.GetFiles(My.Application.Info.DirectoryPath & "\Games\" & game & "\000.zip").Length
    MessageBox.Show(count)
    It has an error saying it is not a valid directory name.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: How do I Handle .zip files?

    ZIP files are not directories. That's just a nicety provided by Windows Explorer. There is no support built into the .NET Framework for ZIP files. You can either write your own code to handle them at the Stream level or else use a third-part component. I strongly recommend the second option. There are various components available but DotNetZip is very simple to use and it's free.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Re: How do I Handle .zip files?

    Look into using SharpZipLib.

  4. #4

    Thread Starter
    New Member
    Join Date
    May 2011
    Posts
    15

    Re: How do I Handle .zip files?

    Thank you! I will be sure to check that out

  5. #5
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: How do I Handle .zip files?

    Quote Originally Posted by formlesstree4 View Post
    Look into using SharpZipLib.
    I've used both, although neither extensively, and, while I wouldn't say that SharpZipLib is bad at all, I do think that DotNetZip is the simpler to use.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width