日期:2014-05-18  浏览次数:20818 次

求C#写百度帖吧回复
其他都解决了就差最后一步了

------解决方案--------------------
可以用HtmlElement类来模拟点击事件

C# code
  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;
            }