Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6890929
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:20:40+00:00 2026-05-27T06:20:40+00:00

Everything is working fine.. I can Unzip files, from an Zip/Rar .. Archive. The

  • 0

Everything is working fine.. I can Unzip files, from an Zip/Rar .. Archive.
The Problem is, how to Unzip a file, thats in a Directory?

To Unzip a File directly I use (SharpZipLib):

FastZip fastZip = new FastZip();
fastZip.ExtractZip(source, targetDirectory, null);

using (var fs = new FileStream(source, FileMode.Open, FileAccess.Read))
    using (var zf = new ZipFile(fs))
    {
        var ze = zf.GetEntry("toc.out");
        if (ze == null)
        {
            throw new ArgumentException("toc.out", "not found in Zip");
        }

        using (var s = zf.GetInputStream(ze))
        {
            // do something with ZipInputStream
        }
     }
}

Or with DotNetZip/ZipDotNet:

using (ZipFile zip = ZipFile.Read(source))
{
    ZipEntry e = zip["toc.out"];
    e.Extract();
}

Thats not working, cause hes searching the file in the root..
And I also wont do something like: DirectoryName/toc.out
How can I achieve this`? Isn’t there a parameter, where I can include all subfolders – for searching or something similar? 🙁

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T06:20:41+00:00Added an answer on May 27, 2026 at 6:20 am

    You can check the last part of the Name of the entry. Even if the file is in a subfolder, the Name entry would be something like “Folder/file.ext”.
    An extension method to accomplish this would be like:

    public static ZipEntry GetEntryExt(this ZipFile file, string fileName)
    {
        foreach (ZipEntry entry in file)
        {
            if (entry.IsFile && entry.Name.EndsWith(Path.DirectorySeparatorChar + fileName))
                return entry;
        }
    
        return null;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am sending email from my iPhone application. Everything working fine, but I want
I'm working on a localized app and everything is working fine. The problem is
Here is my code, everything is working fine the only problem is with the
im trying to create offline desktop application. everything is working fine. The only problem
Everything was working fine before upgrading but now I can't run rake tasks.. any
I have a page where everything is working fine, but the one problem is
can anyone help me with this code. Everything is working fine except this piece
I've got an embedded widget from The Weather Channel and everything is working fine
I am exporting my List to CSV file through Servlet. Everything is working fine.
I'm using fpdf to create some pdf's from a HTML-form. Everything is working fine

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.