以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助]内置浏览器控件内输入问题  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=121367)

--  作者:bailang121
--  发布时间:2018/7/4 16:57:00
--  [求助]内置浏览器控件内输入问题
Dim web As System.Windows.Forms.WebBrowser = e.Form.controls("webbrowser1").basecontrol
Dim Inputs = web.Document.GetElementById("login").GetElementsByTagName("input")
For Each Input As object In Inputs
    If Input.id = "kw" Then
        Input.SetAttribute("value", "abc")
    ElseIf input.id = "wd"
        Input.SetAttribute("value", "123")
    ElseIf Input.id = "btnQyyhdl" Then
    End If
Next


‘’-------------------------我想实现的是在内置浏览器内打开百度,在百度的输入框内输入相对应的文字进行搜索工作。。。根据吧内有的教程,编写了如上代码,为何没用呢?  哪里出错啦~    “kw”,“wd”为百度输入框的id及name。。。。   好几年没接触foxtable啦~   啥都不会啦~     请大神帮忙看一下~~~~

--  作者:bailang121
--  发布时间:2018/7/4 17:46:00
--  
自己顶一个~   求助求助!~ 在线在等在~~~~~ 唉!~
--  作者:bailang121
--  发布时间:2018/7/4 18:06:00
--  
运行提示:未将对象引用到实例~      是哪个出问题了~
--  作者:有点甜
--  发布时间:2018/7/4 21:45:00
--  
Dim web As System.Windows.Forms.WebBrowser = e.Form.controls("webbrowser1").basecontrol
web.ScriptErrorsSuppressed = true
Dim Inputs = web.Document.GetElementById("form").GetElementsByTagName("input")
For Each Input As object In Inputs
    If Input.id = "kw" Then
        Input.SetAttribute("value", "abc")
    ElseIf Input.id = "su" Then
        input.InvokeMember("click")
    End If
Next