通过桌面表单自动填写Web表单 [英] auto fill web form through a desktop form

查看:123
本文介绍了通过桌面表单自动填写Web表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨 我有一个网页,其中包含三个下拉菜单和一个按钮.我想使用包含相同下拉菜单和按钮的c Sharp创建一个桌面应用程序.用户从下拉菜单中选择并单击按钮,然后在网页中自动选择选定的项目.

解决方案

错误的主意.为什么这样做?

Web浏览器没有以这种方式自动化它们的通用标准. IE为此提供了一个系统(例如,参见CodeProject文章自动化Internet Explorer [ https://addons.mozilla.org/en-US/firefox/addon /imacros-for-firefox/ [ http://msdn.microsoft.com/en-us/library/system. windows.forms.webbrowser.aspx [ ^ ],
http://msdn.microsoft.com/zh-cn/library/system.windows.controls.webbrowser%28v = vs.95%29.aspx [ 解决方案

Bad idea. Why doing so?

Web browsers do not have a common standard of automating them in this way. IE has one system for it (see for example the CodeProject article
Automating Internet Explorer[^], there are some commercial products), FireFox — is some other way (see https://addons.mozilla.org/en-US/firefox/addon/imacros-for-firefox/[^]), and I hope some Web browser developers are clever enough to avoid messing with this stuff. There is no a compatible way and hence there is no much value in such manipulations.

Alternatively I can suggest that instead of attempting to work with every external Web browser and a separate process, you embed a Web browser in your desktop application. For example, you can use System.Windows.Forms.WebBrowser or System.Windows.Controls.WebBrowser, please see:

http://msdn.microsoft.com/en-us/library/system.windows.forms.webbrowser.aspx[^],
http://msdn.microsoft.com/en-us/library/system.windows.controls.webbrowser%28v=vs.95%29.aspx[^].

(You should have tagged your UI library you want to use in your question: WPF, Forms, what? It is very unpleasant to type double answer just because you did not take an extra second to specify it. Next time, please always tag it. If you don''t made a choice yet, tag all what apply.)

—SA


这篇关于通过桌面表单自动填写Web表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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