Пример #1
0
        private void CopiaArquivos(string origem, string destino)
        {
            try
            {
                FileInfo origemInfo = new FileInfo(origem);
                if (Directory.Exists(destino))
                {
                    destino += '\\' + origemInfo.Name;
                }
                percent = (100 * arqAtual) / numArqs;
                bgw.ReportProgress(percent);
                Conecta c = new Conecta(destino, BoxUser.Text, BoxSenha.Text);
                File.Copy(origem, destino, true);
                string[] er = new string[] { "Sucesso", " : Arquivo Copiado \n" };

                bgw.ReportProgress(percent, er);
                arqAtual++;
            }
            catch (Exception e)
            {
                string[] er = new string[] { "Erro", " : " + e.Message.ToString() + "\n" };
                bgw.ReportProgress(100, er);
            }
        } //Executa a copia de fato
Пример #2
0
        private void CopiaArquivos(string origem, string destino)
        {
            try
            {
                FileInfo origemInfo = new FileInfo(origem);
                if (Directory.Exists(destino))
                {
                    destino += '\\' + origemInfo.Name;
                }
                percent = (100 * arqAtual) / numArqs;
                bgw.ReportProgress(percent);
                Conecta c = new Conecta(destino, BoxUser.Text, BoxSenha.Text);
                File.Copy(origem, destino, true);
                string[] er = new string[] { "Sucesso", " : Arquivo Copiado \n" };

                bgw.ReportProgress(percent, er);
                arqAtual++;
            }
            catch (Exception e)
            {
                string[] er = new string[] { "Erro", " : " + e.Message.ToString() + "\n" };
                bgw.ReportProgress(100, er);
            }
        } //Executa a copia de fato