Pregunta

I want to code a simple file downloader in C#. I want to know how it works? eg. If I give it a URL, what will it do? I have a very rough idea about it.

  1. It will send a HTTP request.
  2. The server will reply and send the file.
  3. The downloader will get the file and store it in hard drive.

This is my first time coding on web technology. So I hardly have any idea.
Can anybody please explain me the steps?

¿Fue útil?

Solución

A snippet to get you started:

using(var wc=new WebClient())
{
    wc.DownloadFile("http://some/internet/resource",@"c:\some\local\filename");
}
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top