Click here to Skip to main content
15,887,821 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How to stop web client downloading process and save it
and after that reset the process again

I don't want return downloading process to start I want to save it

What I have tried:

void start()
    {
        Uri source = new Uri(comboBox1.Text);
        file = source.ToString();
        button1.Text = "Stop";
        wc.OpenRead(source);
        path = comboBox2.Text;
        wc.DownloadProgressChanged += (s, z) =>
        {
            label3.Text = $"Downloaded as MB: {((float)z.BytesReceived / 1048576).ToString("#.#")}";
            label4.Text = $"Downloaded {z.ProgressPercentage}%";
            progressBar1.Value = z.ProgressPercentage;
            timer1.Start();
        };
        wc.DownloadFileAsync(source, path + Path.GetFileName(source.ToString()));
        button3.Visible = true;
    }
    void stop()
    {
        wc.CancelAsync();
        button1.Text = "Start";
    }
Posted
Comments
[no name] 8-May-19 17:37pm    
https://www.codeproject.com/Articles/21053/MyDownloader-A-Multi-thread-C-Segmented-Download-M

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900