日期:2014-05-18 浏览次数:21006 次
public static HtmlElement FindControlByAttValue(string Tag, string AttName, string AttValue, HtmlElementCollection listOfHtmlControls)
{
foreach (HtmlElement element in listOfHtmlControls)
{
if (!string.IsNullOrEmpty(element.OuterHtml))
{
if (element.TagName == Tag)
{
if (element.OuterHtml.Contains(AttValue))
{
if (element.InnerHtml.Contains("回复"))
{
return element;
}
}
}
}
}
return null;
}