从Windows表单中刮取数据 [英] Scrapping data from a windows form

查看:126
本文介绍了从Windows表单中刮取数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hai
我需要从屏幕上抓取数据.我有一个Windows窗体.打开此表单后,应将表单上可用的数据作为表格获取,并存储在Excel文件中.我可以拍摄该表格的屏幕截图.但是我不知道如何从图像中删除数据.请帮我解决这个问题. 这很紧急. 是吗?预先感谢.

Hai Hi,
I am in the need of scrapping data from a screen. I have a windows form. When this form opened the data available on the form as a table should be taken and stored in an Excel file. I can take screen shot of the form. But I don''t know how to scrap data from the image. Please help me in this issue. It is urgent. Is it? Thanks in advance.

推荐答案

过去,您可以从仿真器(如VT100)上抓取文本.它们是基于文本的.

您可以从网络浏览器中抓取文本,因为它们是基于文本(HTML)的.

但是典型的Windows窗体是渲染的图形图像.您将不得不诉诸OCR.那是一大堆您不愿打开的蠕虫.

您也许可以使用旧的Windows Get Text消息.您需要获取主窗口句柄,然后迭代子窗口.

Windows消息为WM_GETTEXT.

http://msdn.microsoft.com/en-us/library/ms632627 (v = vs.85).aspx [
In the old days, you could scrape text off of emulators (like the VT100). They were text based.

You can scrape text off of web browsers because they are text based (HTML).

But a typical windows form is a rendered graphical image. You would have to resort to OCR. That''s a pretty big can of worms you don''t to open.

You might be able to use the old Windows Get Text message. You would need to get the main window handle and then iterate the child windows.

The windows message is WM_GETTEXT.

http://msdn.microsoft.com/en-us/library/ms632627(v=vs.85).aspx[^]

I would google WM_GETTEXT and whatever language you are using.


使用Excel(Office)InterOp.
Use Excel (Office) InterOp.


这篇关于从Windows表单中刮取数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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