Ionic.Zip Complete Extract C#

Asked

Viewed 20 times

-1

Hello I am using using using Ionic.Zip; and this extracting right however at the end when it finishes extracting need to erase the ZIP file q it was extracting and I am not seeing function to identify when it finishes extracting the files, someone has been through it and has some idea of how to do it ?

What I tried was :

 private void Zip_ExtractProgress(object sender, ExtractProgressEventArgs e)
    {
        double dFalta = ((e.TotalBytesToTransfer - e.BytesTransferred) / 1024);
        lbCompletoExtrair.Text = "Extraindo dados : " + dFalta.ToString();
        lbCompletoExtrair.Refresh();
        if (dFalta == 0)
        {
            lbSair.Visible = true;
        }
    }

But it didn’t work out he sometimes doesn’t get into the if.

  • Wouldn’t it be a question of you checking all the bytes already downloaded? if (e.TotalBytesToTransfer <= 0)

1 answer

0

Hello Thank you for the reply, I resolved as follows,

double dTotalBytesParaTransferir = e.TotalBytesToTransfer;
double dTotalBytesTransferidos = e.BytesTransferred;
if (dTotalBytesParaTransferir == dTotalBytesTransferidos)
{

}

Browser other questions tagged

You are not signed in. Login or sign up in order to post.