i have created the downloader file
private void btnTestDownload_Click(object sender, EventArgs e)
{
backgroundWorker1.RunWorkerAsync();
}
and work! but
private void btnTestDownload_Click(object sender, EventArgs e)
{
backgroundWorker1.CancelAsync();
}
the backgroundWorker dos not stop!
It sounds like you’ve got completely the wrong idea about the purpose of a background worker. If you want to download a single file asyncronously with the ability to cancel it, all this functionality is built into the WebClient class.
Background worker is for long running tasks which are, on the whole, processor intensive. For example, if the file you were downloading were a large text file and you needed to parse each line of the text file, you could use the background worker for that, e.g.
Downloading a File
Processing a File