Tuesday, January 5, 2010

Download any file or image from internet

If you have got URL of images and you want to download that files to your harddisk from internet then this function will help u:
NOTE: remember that your URL must contain protocol name like "http://"
eg: "http://www.mywebsite.com/aa.jpg"

My.Computer.Network.DownloadFile(Url, "c:\myfolder" & "\" & Url.Substring(url.LastIndexOf("/") + 1))

in above code "Url" is your file Url on internet
and second parameter is where you want to save file.. in above sample code it will get the file name from Url and save it in C:\myfolder with the same name as it was on internet

Share This!

No comments:

Powered By Blogger · Designed By Seo Blogger Templates