日期:2014-05-17  浏览次数:21256 次

C# mshtml 实现模拟点击a标签
<IFRAME style="DISPLAY: none" src="about:blank"></IFRAME>
<DIV class=search_container>
<DIV class=search_input><INPUT tabIndex=1 id=search_input class=yahei maxLength=50 type=input> <SPAN onclick="$('search_input').focus();return false;" id=search_tips onselectstart="return false;" style="DISPLAY: block">请输入群号、关键词,多关键词间用空格隔开</SPAN> </DIV><A tabIndex=2 id=search_btn class=search_btn hideFocus href="javascript:void(0)">查找</A> 
<DIV class=search_hot style="DISPLAY: none">热门搜索:&nbsp;<A href="javascript:void(0)">同城</A>&nbsp;&nbsp;<A href="javascript:void(0)">旅游</A></DIV>
<DIV id=tips class=tips>请输入群号或关键词再点击查找</DIV>
<UL id=search_auto class=search_auto style="DISPLAY: none">
<LI><A class=select hideFocus href="#">英雄联盟</A> </LI></UL></DIV>
<DIV id=content>
<DIV class=group_think style="MARGIN-TOP: 10px">
<H2>您可能感兴趣的群</H2><A id=change_btn class=change hideFocus style="DISPLAY: inline-block" href="javascript:void(0)">换一批</A>
<UL id=content_recommend style="VISIBILITY: visible">
<LI id=li_48715864 style="ZOOM: 1" data-gc="48715864">
<DIV class=ie-bg></DIV><A onclick="Evts.delRecom(this);return false;" class=cls href="http://qqun.qq.com/search/index.html?keyword=#"></A><A class=head hideFocus href="javascript:void(0)"><IMG onerror=HeadError(this) id=head_48715864 src="http://3.url.cn/qun/search/img/head.png"></A> 
<P><A id=name_48715864 title=长春龟友群 class=name hideFocus href="javascript:void(0)">长春龟友群</A><BR><B title=生活休闲-宠物>生活休闲-宠物</B><BR><SPAN title=喜欢龟龟的都来聊聊吧!>喜欢龟龟的都来聊聊吧!</SPAN> </P><A id=report_48715864 class=report hideFocus href="javascript:void(0)">举报</A> 
<DIV class=tool><SPAN>68&nbsp;人</SPAN> <A id=add_48715864 class=add hideFocus href="javascript:void(0)">加入</A> </DIV>
<DIV class=hot></DIV></LI>

</SCRIPT>

mshtml 如何实现模拟点击加群。

   /// <summary>
        /// 输入群号码
        /// </summary>
        /// <param name="hWnd"></param>
        /// <param name="Values"></param>
        /// <returns></returns>
        public bool Setvalue(IntPtr hWnd, string Values)
        {
            try
            {
                IHTMLDocument2 htmlDoc = GetHtmlDocument(hWnd);
                if (htmlDoc != null)
     &nbs