从另一个屏幕输入c sharp程序 [英] Taking input in c sharp program from another screen

查看:65
本文介绍了从另一个屏幕输入c sharp程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须为呼叫中心开发数据库,​​他们有一个由公司提供的软件。当他们接到电话时,呼叫者的号码会显示在该呼叫程序内的小屏幕中。



我必须将该来电显示作为我的数据库的输入为了保存和搜索有关用户的地址和其他信息。

一位朋友告诉我关于Auto IT您可以采取这种类型的输入,但我想用c#创建它,我甚至都不知道要搜索什么。有人可以指导我正确的方向吗?或者分享一些例子

I have to develop a data base for calling center, they have a software provided by the company. when ever they get a call the number of caller is shown in a minor screen inside that calling program.

I have to take that caller ID as input for my database in order to save and search the address and other information about user.
A friend told me about Auto IT that you can take this type of input but i want to create it in c #, i dont even know what to search for it. can someone direct me to right direction ? or share some example

推荐答案

如果我理解你的问题是正确的:让我们想象办公室的某个地方有一个工人,他或她接到一个电话部分视频/音频对话程序(该程序显示您需要检索的一些呼叫ID)。通常,数字可以由工作人员写下来从数据库中检索信息,但这是您不想自动执行此部分的地方。因此,如果您无法改变第三方程序并且第三方程序没有任何公共API来获取该调用者ID,则只有一种解决方案可以自动执行此过程 - 抓取数据。这可以通过以下三种方式完成:



1)使用图像模式分析和识别进行刮擦。基本上你必须根据你对它的了解来分析程序的图像。也许调用者ID显示在程序的相同位置,或者在某个定义的位置,或者您可以看到一些规则显示的位置和方式。然后使用光学字符识别从图像中解析该数字。为了获得包括性能在内的最佳结果,我建议根据该程序编写自己的实现(收集图像并进行分析)。或者您可以使用矢量光学识别(类似于指纹识别),这在一个特定情况下不太准确,但更抽象,可用于不同的字体,大小,重量等。



2)使用win api进行刮擦。如果使用默认的Windows组件编写第3个程序,则可以使用spyxx.exe( https://msdn.microsoft.com/en-us/library/aa242713(v = vs.60).aspx [ ^ ])了解程序结构,然后找到windows中孩子的那个来电显示。如果程序使用某些图形呈现来显示该调用者ID,则此方法无论如何都无济于事。否则,如果你可以访问该窗口的标签,文本框(或其他一些组件)并从中检索数据,那么很酷,这是一种简单而快速的方法。如果(不包括异常处理和SOLID编程)检索该调用者可能需要大约50个代码行。



3)注入进程并超越windows消息以便在显示/呈现调用者ID或其他任何内容并获取它。这是侵入性的,很可能会破坏一些EULA或合同。简单来说就是黑客攻击。



在所有这些情况下你应该知道第三部分程序的结构将来可能会改变,你的抓取方法会赢得'再工作了。



Martynas A。
If I understood you problem correctly: let's imagine there is a worker somewhere in the office and he or she receives a call in some sort of 3rd part video/audio conversation program (and that program shows some call id you need to retrieve). Usually number can be written down by the worker to retrieve info from database, but that's where you wan't to automate this part. So if you can't alter that 3rd party program and that 3rd party program does not have any public api to get that caller id, there is only one solution to automate this process - scraping data. This can be done in most likely 3 ways:

1) Scraping using image pattern analysis and recognition. Basically you have to analyze the image of the program depending on what you know about it. Maybe the caller id is shown in the same place of the program, or at some defined place or you can see some 'rules' where and how it's displayed. Then use optical character recognition for parsing that number from image. For best result including performance I would suggest to write your own implementation depending on that program (collect images and analyze them). Or you can use vectorial optical recognition (something similar to fingerprint recognition), this is less accurate taking one particular case, but more abstract and could be used on different fonts, sizes, wights and etc.

2) Scraping using win api. If the 3rd program is written using default windows components, you can use spyxx.exe ( https://msdn.microsoft.com/en-us/library/aa242713(v=vs.60).aspx[^] ) to understand programs structure and then finding where in the windows children is that caller id. If program uses some graphical rendering to display that caller id, this approach won't help in any way. Otherwise if you can reach the label, textbox (or some other component) of that window and retrieve data from it, cool, it's the simple and the fastest way to scrape it. Retrieving that caller if (not including exception handling and SOLID programming) probably would take around 50 code lines.

3) Injecting into process and overtaking windows messages to catch when the caller id is shown/rendered or whatever and get it. This is the invasive and most likely would break some EULAs or contracts. In simple words it's hacking.

And in all these cases you should be aware that the structure of that 3rd part program might change in the future and your scraping method won't work anymore.

Martynas A.


这篇关于从另一个屏幕输入c sharp程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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