04-22-2012, 04:29 PM
you should use DownloadFileAsync else if the file is bigger u will have proplems
for exampel
void update()
{
WebClient Client = new WebClient();
Client.DownloadProgressChanged += new DownloadProgressChangedEventHandler(Client_DownloadProgressChanged);
Client.DownloadFileCompleted += new AsyncCompletedEventHandler(Client_DownloadFileCompleted);
// starting the download
Client.DownloadFileAsync(new Uri("http:/myadress/myfile.exe"), "myfile.exe");
}
// getting called if any change is there
void Client_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e)
{
progressBar1.Maximum = (int)e.TotalBytesToReceive;
progressBar1.Value = (int)e.BytesReceived;
// u also can make a label where the percent get showed
int percent = (int)(((double)progressBar1.Value / (double)progressBar1.Maximum) * 100);
Label1.text = percent.ToString() + " %";
}
// getting called when its done
void Client_DownloadFileCompleted(object sender, AsyncCompletedEventArgs e)
{
MessageBox.Show("Download done!");
}
and also in ur "Launcher" it download only the ".lod" file but the laucnehr download an ".zip" file what he extract and u also have always the same adress means he always download the same



