10 Replies - 380 Views - Last Post: 28 September 2012 - 10:14 AM Rate Topic: -----

#1 fatcake  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 28-September 12

Downloading a picture off a site.

Posted 28 September 2012 - 05:39 AM

Hi

I was wondering if it is possible that you could program to download a photo offline, but i want it so if it has a certain "id"

If so how do you do this please :)
Is This A Good Question/Topic? 0
  • +

Replies To: Downloading a picture off a site.

#2 _HAWK_  Icon User is offline

  • Master(Of Foo)
  • member icon

Reputation: 1062
  • View blog
  • Posts: 4,138
  • Joined: 02-July 08

Re: Downloading a picture off a site.

Posted 28 September 2012 - 07:14 AM

WebClient is a great class for that.
Was This Post Helpful? 0
  • +
  • -

#3 fatcake  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 28-September 12

Re: Downloading a picture off a site.

Posted 28 September 2012 - 07:21 AM

i don't suppose you may give me a working code or something, i have tried everywhere lol.

thank you
Was This Post Helpful? 0
  • +
  • -

#4 _HAWK_  Icon User is offline

  • Master(Of Foo)
  • member icon

Reputation: 1062
  • View blog
  • Posts: 4,138
  • Joined: 02-July 08

Re: Downloading a picture off a site.

Posted 28 September 2012 - 08:03 AM

Explore this class and give it a try - that's part of being a programmer. We will help you if you are doing the work.
Was This Post Helpful? 0
  • +
  • -

#5 fatcake  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 28-September 12

Re: Downloading a picture off a site.

Posted 28 September 2012 - 08:11 AM

far enough, i am guessing it is the

WebClient.DownloadData Method (Uri)

but how do you expand on this to grab a id= "..."

please, i am very new to it, but i do have a look on you tube and there is nothing
Was This Post Helpful? 0
  • +
  • -

#6 _HAWK_  Icon User is offline

  • Master(Of Foo)
  • member icon

Reputation: 1062
  • View blog
  • Posts: 4,138
  • Joined: 02-July 08

Re: Downloading a picture off a site.

Posted 28 September 2012 - 08:43 AM

What is this 'ID' part?
Was This Post Helpful? 0
  • +
  • -

#7 no2pencil  Icon User is offline

  • Admiral Fancy Pants
  • member icon

Reputation: 5380
  • View blog
  • Posts: 27,350
  • Joined: 10-May 07

Re: Downloading a picture off a site.

Posted 28 September 2012 - 08:49 AM

View Postfatcake, on 28 September 2012 - 10:21 AM, said:

i don't suppose you may give me a working code or something, i have tried everywhere lol.

Dream In Code is a community of developers. Seems you may have missed trying the most important place... yourself. Give it a go, you may even surprise yourself.

However if you want a copy & paste solution, you are in the wrong place my friend.
Was This Post Helpful? 0
  • +
  • -

#8 fatcake  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 28-September 12

Re: Downloading a picture off a site.

Posted 28 September 2012 - 09:00 AM

@hawk, it is the html element id of the picture
Was This Post Helpful? 0
  • +
  • -

#9 _HAWK_  Icon User is offline

  • Master(Of Foo)
  • member icon

Reputation: 1062
  • View blog
  • Posts: 4,138
  • Joined: 02-July 08

Re: Downloading a picture off a site.

Posted 28 September 2012 - 09:32 AM

Is this from a webBrowser? If so, you parse the WebBrowser.Document

As far as the WebClient method above you where thinking of DownloadData which is a byte array of the file - or did you catch that. There is a DownloadFile(url, string) and DownloadFileAsync(url, string)
Was This Post Helpful? 0
  • +
  • -

#10 fatcake  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 28-September 12

Re: Downloading a picture off a site.

Posted 28 September 2012 - 10:04 AM

yes it is part of a webbrowser, i want it to select a photo using it's id and then download it to a location. sorry for the confusion. thanks so far
Was This Post Helpful? 0
  • +
  • -

#11 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9487
  • View blog
  • Posts: 35,772
  • Joined: 12-June 08

Re: Downloading a picture off a site.

Posted 28 September 2012 - 10:14 AM

Yes.. you'll have to read in the page as a string.. search through it for your tag, and pull out the value between the tag found and the closing div.

Regex, a for loop, string.indexof, etc all can do the trick.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1