今天需要在弄个 模拟登录到别的网站发表文章, 登录和哪些简单的都已经好弄
一 
卡在webbrowser.获取select的时候,我该怎么去指定它选中的第几项,然后去执行select的change事件
 wb.Document.GetElementById("areaId").SetAttribute("selectedIndex", "2");   感觉就SetAttribute("selectedIndex", "1"); 的时候可以,为2以上行不通了。。
onchange  更加不知道怎么去弄了。。onchange 的js是 “changeArea(this)” 这样的js 

也是webbrowser 来实现的, 一个文本框, 是关键字提示的,   
我在wb.Document.GetElementById("tbkeyword").InnerText("美好");
输入后下面跟像百度的一个层显示热门的10条关键字
能鼠标下去可以选中第一条, 因为10条记录是都在层的<li>里面上   我需要执行<li>有个onclick事件, 谢谢呢。第一次在项目中用webbrowser。谅解

解决方案 »

  1.   

     第一个问题
      HtmlElement keyword= wb.Document.GetElementById("keyword");
      HtmlElement education_item = null;
                    for (int i = 0; i < keyword.Children.Count; i++)
                    {
                        if (keyword.Children[i].InnerText == "美好")
                        {
                            education_item = keyword.Children[i];
                            break;
                        }
                    }
                    if (education_item == null)
                    { 
                        // AddLog_ZP("发布失败", "失败,可能是页面改版或者打开页面失败(9)。");
                      
                    }
                    education_item.SetAttribute("selected", "selected");
                    areaId1.RaiseEvent("onchange");第一个实现了。 期待第二个答案。。谢谢啦。。