手机
当前位置:查字典教程网 >网页设计 >脚本HTML教程 >从html代码中获取Img标签
从html代码中获取Img标签
摘要://////获取Img标签//////截获到的html代码///publicstaticListGetPadImg(stringhtmlTe...

  /// <summary>
/// 获取Img标签
/// </summary>
/// <param name="htmlText">截获到的html代码</param>
/// <returns></returns>
public static List<string> GetPadImg(string htmlText)
{
List<string> list = new List<string>();
Regex regImg = new Regex(@"<imgb[^<>]*?bsrc[strn]*=[strn]*[""']?[strn]*(?<imgUrl>[^strn""'<>]*)[^<>]*?/?[strn]*>", RegexOptions.IgnoreCase);
MatchCollection mc = regImg.Matches(htmlText);
foreach (Match m in mc)
{
list.Add(m.Groups["imgUrl"].Value); //获取Img标签
}
return list;
}

【从html代码中获取Img标签】相关文章:

XHTML代码常见应用问题

36个重要的HTML标签

xhtml的结构标签

为Html的Select加一个提示语和输入方法

返回到上一页的html代码的几种写法

python获取标准北京时间的方法

Html标签简明教程

iframe代码—网页中嵌入其他网页

html中设置让div中的内容超出后自动显示滚动条

html标签:sub标记和sup标记

精品推荐
分类导航