VS 2010在WebBrowser中填写文本框 [英] VS 2010 Filling textbox in WebBrowser

查看:81
本文介绍了VS 2010在WebBrowser中填写文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好在这个地方插入文字并使用文本框?





hello insert text in this place and using the textbox?


Dim allelements As HtmlElementCollection = WebBrowser1.Document.All
    For Each webpageelement As HtmlElement In allelements

        If webpageelement.GetAttribute("guidedhelpid") = "sharebox_editor" Then
            webpageelement.InvokeMember("click")
        End If
    Next
End Sub





sharebox_editor这个评论框。



sharebox_editor this box to comments.

推荐答案

问题不明确,但如果你问如何获得控制参考......



您已经通过GetAttribute找到了控件。只需将其转换为正确的类型而不是通用的html元素。



The question is not clear, but if you're asking how to get control reference...

You already found the control via GetAttribute. Just cast it into proper type instead of generic html element.

If TypeOf webpageelement is TextBox
    dim txt as TextBox = DirectCast(webpagelement, TextBox)
    txt.Text = "Your text"
End If





如果这样可以解决您的问题,请花点时间接受这个解决方案,以便您帮助其他有类似问题的人。



If this solves your problem, please take the time and accept this solution so you help others with similar problem(s).


这篇关于VS 2010在WebBrowser中填写文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆