日期:2014-05-17 浏览次数:20501 次
string strHtml = "Your html string";
HtmlAgilityPack.HtmlDocument doc = new HtmlDocument();
doc.LoadHtml(strHtml);
HtmlNodeCollection imgs = doc.DocumentNode.SelectNodes("img");
string src = String.Empty;
if (imgs.Count > 0)
{
src = imgs[0].Attributes["src"].Value;
}