-1

i have seen further question answers but cannot get a clear answer.

foreach (HtmlNode cat2 in doci.DocumentNode.SelectNodes(".//a/@href | //img/@src"))

in this i am getting src in img tag i want to download that image and store it into database.what should i do? is it possible with html agility pack to download image if so, then tell me how to get and assign it to a variable then i can store in my DB

var imagePath = cat2.Attributes["src"].Value;

this is not working too

Shah Rukh
  • 227
  • 1
  • 2
  • 11
  • I have no idea why my answer is being down-voted.I have shown in my answer exactly how to retrieve the image and assign it to a variable (which is what the OP asked for!!!!!!!!!!!!!!!!!!!!!!!) – Seany84 Apr 12 '16 at 22:29

1 Answers1

-1

The code you have write will only get the link of the image and u can save it in your DB and then make a client use that stored URL of the image and then u can download the image thanks

  • ohh thanks thanks dude for all your support people don't even reply and i am blocked from asking questions thank u again – Shah Rukh Apr 22 '16 at 05:39