code to download images or files
i need code to download images or files
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Rajendra TripathyPosted Aug 27, 2014, 10:14 AM
string myFilename = @"c:\MyImg.jpg";
using(WebClient client = new WebClient())
{
client.DownloadFile("http://www.abc.com/car.jpg", myFilename);
}
** But before that you need to validate the availability of the image
Farhan ShariffPosted Aug 25, 2014, 9:55 AM
using(WebClient client = new WebClient())
{
client.DownloadFile("http://www.example.com/image.jpg", localFilename);
}