<< Click to Display Table of Contents >> Baixar arquivos de http com progressbar |
![]() ![]() ![]() |
using System;
using System.Net;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
progressBar1.Visible = true;
WebClient webClient = new WebClient();
webClient.DownloadProgressChanged += (s, args) =>
{
progressBar1.Value = args.ProgressPercentage;
};
webClient.DownloadFileCompleted += (s, args) =>
{
progressBar1.Visible = false;
};
webClient.DownloadFileAsync(new Uri("https://dl.dropboxusercontent.com/u/66061710/atualizador/gestor.zip"), @"S:\gestor.zip");
}
}
}