コード例 #1
0
        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);
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: danygolden/gianfratti
 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);
 }