Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to download a file from a website in C# [closed]

Is it possible to download a file from a website in Windows Application form and put it into a certain directory?

like image 821
S3THST4 Avatar asked Feb 08 '09 07:02

S3THST4


People also ask

How do I download a file from a website using C++?

Something as simple as: std::string s; s=download("http://www.example.com/myfile.html"); Ideally, this would include URLs like: ftp://example.com/myfile.dat.


1 Answers

With the WebClient class:

using System.Net; //... WebClient Client = new WebClient (); Client.DownloadFile("http://i.stackoverflow.com/Content/Img/stackoverflow-logo-250.png", @"C:\folder\stackoverflowlogo.png"); 
like image 159
Christian C. Salvadó Avatar answered Sep 23 '22 06:09

Christian C. Salvadó