I'm creating a system that takes files from a server and copies it to my machine. I work in a software company and as we can not install systems from outside, I decided to create one myself. The system is up and running, but I'm improving it.
I need to insert a progress bar so I can track the status of the copy. I created another Form2.cs window where the toolbar is, I configured the call of the window, however I am in doubt when making the call of the bar for loading.
Follow the code:
private void button1_Click(object sender, EventArgs e)
{
//Chamar outra janela
atualizainstaladores2.Form2 barra = new atualizainstaladores2.Form2();
barra.ShowDialog();
if (!Directory.Exists(@"E:\InstaladoresSHOP\Sistemas"))
{
//criar o diretório caso não exista
// copiar de PDV todos os arquivos com .exe no final
Directory.CreateDirectory(@"E:\InstaladoresShop\Sistemas\Shop\PDV");
string[] PDV = Directory.GetFiles(@"C:\Users\thale\Downloads\Sistemas\Sistemas\PDV", "*.exe");
foreach (string item in PDV)
{
File.Copy(item, @"E:\InstaladoresShop\Sistemas\Shop\PDV\" + Path.GetFileName(item));
}
MessageBox.Show("Diretorio PDV atualizado com Sucesso!!");
}