private void btnCompactarDiretorio_Click(object sender, EventArgs e) { //Verifia se o diretorio de origem existe if (!Directory.Exists(txtDiretorioOrigem.Text)) { MessageBox.Show("O Diretório de Origem informado não existe"); return; } //Verifia se o diretorio de destino existe if (!Directory.Exists(txtDiretorioDestino.Text)) { MessageBox.Show("O Diretório de Destino informado não existe"); return; } btnCompactarDiretorio.Text = "Cancelar"; lblMsg.Text = "Aguarde enquanto os arquivos são compactados"; progressBar1.Style = ProgressBarStyle.Marquee; ZipaArquivosHandler operacaoZipar = new ZipaArquivosHandler(gerarZipDiretorio); operacaoZipar.BeginInvoke(txtDiretorioOrigem.Text, txtDiretorioDestino.Text, new AsyncCallback(RetornoDoZip), null); }