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

  • Home
  • SEARCH
  • 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 5957225
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:22:14+00:00 2026-05-22T18:22:14+00:00

The ExtractProgressEventArgs.EntriesTotal and ExtractProgressEventArgs.EntriesExtracted is always zero. Is this a known bug? See my

  • 0

The ExtractProgressEventArgs.EntriesTotal and ExtractProgressEventArgs.EntriesExtracted is always zero. Is this a known bug? See my code below:

public static void UnZip(string zipFile, string destination)
{
    using(ZipFile zip = ZipFile.Read(zipFile))
    {                
        zip.ExtractProgress += new EventHandler<ExtractProgressEventArgs>(zip_ExtractProgress);

        foreach (ZipEntry entry in zip)
        {
            entry.Extract(destination, ExtractExistingFileAction.OverwriteSilently);                    
        }
        Console.WriteLine("DONE");
    }
}

static void zip_ExtractProgress(object sender, ExtractProgressEventArgs e)
{
    if(e.EventType == ZipProgressEventType.Extracting_AfterExtractEntry)
        Console.WriteLine(String.Format("{0} : {1} / {2} = {3}%", e.CurrentEntry.FileName, e.EntriesTotal, e.EntriesExtracted, ((double)e.EntriesTotal / (double)e.EntriesExtracted) * 100.00));
}
  • 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-22T18:22:14+00:00Added an answer on May 22, 2026 at 6:22 pm

    It’s defined behavior:

    from http://cheeso.members.winisp.net/DotNetZipHelp/html/91d797c7-efff-99a3-2b14-6c9a9797b324.htm

    EntriesExtracted Number of entries extracted so far. This is set only if the EventType is Extracting_BeforeExtractEntry or Extracting_AfterExtractEntry, and the Extract() is occurring witin the scope of a call to ExtractAll().

    The reason for this is simple: If you call Extract() in a loop that you yourself control, there’s no way for the library to know how many times you plan to call it, how many times you’ve called it in a row, whether to count the first 5 times with the next 5 times, and so on. So DotNetZip can’t give you reliable informaiton about how many you’ve done.

    You have two easy workarounds available:

    • use an int counter that you increment for each call to Extract() in your loop.

    • call ExtractAll(), In that case it will issue ExtractProgressEvents with the EntriesExtracted value set to a meaningful number.

    option 1:

        int n;
        using(ZipFile zip = ZipFile.Read(zipFile))
        {                
            zip.ExtractProgress += zip_ExtractProgress;
            n = 0;
            foreach (ZipEntry entry in zip)
            {
                n++;
                entry.Extract(destination, ExtractExistingFileAction.OverwriteSilently);                    
            }
            Console.WriteLine("DONE");
        }
    

    option 2:

        using(ZipFile zip = ZipFile.Read(zipFile))
        {                
            zip.ExtractProgress += zip_ExtractProgress;
            zip.ExtractAll(destination,
                   ExtractExistingFileAction.OverwriteSilently);                    
            Console.WriteLine("DONE");
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

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.