M
M
Maxim K2022-01-03 23:19:20
C++ / C#
Maxim K, 2022-01-03 23:19:20

How to track that the file has downloaded?

Implemented a simple method for downloading files:

private void button2_Click(object sender, EventArgs e)
        {
            for (int i=0; i<=listBox1.Items.Count; i++)
            {
                var desktop = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
                string fileName = desktop + "\\" + i +".mp3";
                WebClient webClient = new WebClient();
                webClient.DownloadFile(listBox1.Items[i].ToString(), fileName);
            }
        }

I did not find information on DownloadFile, namely, how to find out if the file was downloaded or not.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question