Ответ 1
Здесь есть старое решение:
http://p2p.wrox.com/c/42780-mshtml-how-get-images.html#post169674
В эти дни, хотя вы, вероятно, захотите проверить Hmml Agility Pack:
http://htmlagilitypack.codeplex.com/
Документация не совсем велика; поэтому этот фрагмент кода может помочь:
HtmlDocument htmlDoc = new HtmlDocument();
htmlDoc.LoadHtml(html);
// You can also load a web page by utilising WebClient and loading in the stream - use one of the htmlDoc.Load() overloads
var body = htmlDoc.DocumentNode.Descendants("body").FirstOrDefault();
foreach (var img in body.Descendants("img"))
{
var fileUrl = img.Attributes["src"].Value;
var localFile = @"c:\localpath\tofile.jpg";
// Download the image using WebClient:
using (WebClient client = new WebClient())
{
client.DownloadFile("fileUrl", localFile);
}
}