0

Possible Duplicate:
How to use httpwebrequest to pull image from website to local file

Let said, I have a picture a http://abc.com/image/abc.jpg and I would like to download it and save into the own storage in my windows 8 store application (not store into the picture library), so that my application can call and display the image and the image is not seem from picture library.

how to achieve the above task with c# ? code samples? thanks!

Community
  • 1
  • 1
Snake Chia
  • 181
  • 1
  • 3
  • 13

1 Answers1

0

Probably better to let the browser cache this as that plumbing is already in place.

If you really want to pull this off, use HttpWebRequest is the class to use and How to use httpwebrequest to pull image from website to local file seems to have a descent answer.

Community
  • 1
  • 1
robrich
  • 13,017
  • 7
  • 36
  • 63
  • This code NO LONGER working for Windows 8 Store app aka metro app. – Snake Chia Jan 06 '13 at 02:43
  • Yep, this shouldn't be a duplicate as it concerns a Windows Store App. You should find some useful code here: http://stackoverflow.com/questions/14786460/store-image-in-to-storagefile-from-image-control – Johann Aug 28 '13 at 06:22
  • Here is another approach: http://social.msdn.microsoft.com/Forums/windowsapps/en-US/09f51999-b8c4-4d25-8c53-a03ae1884c16/windows-metro8-download-image-file-from-url-and-save-it-to-appdata – Johann Aug 28 '13 at 07:20