当前位置: 代码迷 >> VB Dotnet >> webbrowser模拟点击不了。求解,该如何解决
  详细解决方案

webbrowser模拟点击不了。求解,该如何解决

热度:178   发布时间:2016-04-25 02:02:02.0
webbrowser模拟点击不了。求解
<a href="javascript:;" node-type="uploadmode" onclick="return false;">普通上传模式</a>
以上是该按钮的代码, 使用以下代码点击无效,求大牛指导
Dim html As HtmlDocument = Me.WebBrowser1.Document
                For Each ht As HtmlElement In html.All
                    If ht.GetAttribute("node-type") = "sel_uploadmode" Then    '选择普通上传
                        ht.SetAttribute("style", "display: none;")
                    End If
                Next
------解决思路----------------------
???If ht.GetAttribute("node-type") = "sel_uploadmode" Then 
------解决思路----------------------
  If ht.GetAttribute("node-type") = "uploadmode" Then    '选择普通上传
------解决思路----------------------
 ht.SetAttribute("style", "display: none;")

你这句是干嘛的


参考http://blog.sina.com.cn/s/blog_58e7f835010009dg.html
------解决思路----------------------
获取到对象后,使用
 Obj.InvokeMember("Click")

可模拟点击
  相关解决方案