将密钥发送到twebbrowser? [英] Send keys to a twebbrowser?

查看:63
本文介绍了将密钥发送到twebbrowser?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何以编程方式将密钥发送到TWebBrowser,以填写名称和地址之类的数据字段?

How do I programatically send keys to a TWebBrowser to fill in data fields like Name and address?

推荐答案

如果要要伪造输入,您需要使用 SendInput API。

If you want to fake input you need to use the SendInput API.

但是,这将需要您确保所涉及的字段具有输入焦点。我怀疑您最好通过DOM插入数据( IWebBrowser2.Document )。

However, that's going to require you to make sure that field in question has the input focus. I suspect you would be better off poking the data in through the DOM (IWebBrowser2.Document).

这篇关于将密钥发送到twebbrowser?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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