Download Async won't finish the download c#
<p>i'm trying to make an updater that will download from an url with webclient in async mode.</p>

<p>But it cut my download and don't download the full file. </p>

<p>Here's the code :</p>

<pre><code>using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Net;
using System.Diagnostics;

namespace Updater
{
  public partial class Form1 : Form
  {
    public Form1()
    {
        InitializeComponent();
    }

    private void Form1_Load(object sender, EventArgs e)
    {
        WebClient Client = new WebClient();

        Client.DownloadFileCompleted += new AsyncCompletedEventHandler(Completed);
        Client.DownloadFileAsync(new Uri("http://localhost/launcher/"), @"C:\launcher.exe");
    }

    private void Completed(object sender, AsyncCompletedEventArgs e)
    {

        if (e.Error != null)
        {
            string error = e.Error.ToString();
            // or
            // error = "Your error message here";

            MessageBox.Show(error);
            return;
        }

        if (e.Cancelled == true)
        {
        }
        else
        {
            Close();
        }

    }
}
</code></pre>

<p>}</p>

<p>I'm new with c# and still can't figure where's my error. :/
ty</p>

<p>edit : </p>

<p>I missed to say to download the file launcher.exe at this :</p>

<pre><code> Client.DownloadFileAsync(new Uri("http://localhost/launcher/"), @"C:\launcher.exe");
</code></pre>

<p>to this </p>

<pre><code> Client.DownloadFileAsync(new Uri("http://localhost/launcher/launcher.exe"), @"C:\launcher.exe");
</code></pre>

<p>thanks to Адизбек Эргашев for his links and where it help me : <a href="https://stackoverflow.com/a/26232827/6495475">https://stackoverflow.com/a/26232827/6495475</a></p>