Click here to Skip to main content
15,892,674 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
C#
HtmlDocument document = new HtmlDocument();
document.Load("url");

foreach (HtmlNode image in document.DocumentElement.SelectNodes("//img[@src"))
{
    HtmlAttribute url = image["src"];
    imageUrls.Add(url.Value);
}

i m using this code but it is not working on asp.net it's required System.windows.form namespace but i want to do this on my asp.net webpage
Posted
v2

You can use System.Net.WebClient class to download any content from the web. See description and sample code here http://msdn.microsoft.com/en-us/library/ez801hhe(v=vs.110).aspx[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900