使用C#代码和Visual Studio创建一个虚拟扫描程序 [英] Create a faux scanner using C# code and Visual Studio

查看:115
本文介绍了使用C#代码和Visual Studio创建一个虚拟扫描程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前我支持的产品之一就是扫描软件。我的公司太便宜了(不幸的是)给我们买了所有的扫描仪。我们不得不四处寻找,看看有人有一个他们现在没有使用的(在他们的办公桌前)。我提出了一个实验室的概念,人们可以在那里测试东西,他们看着我,就像我是来自另一个星球的外星人。 :-)好的,为了结束这个因为我非常厌倦我以为我会写一些代码来模拟一个扫描仪,也许
传递一个我知道会重现这个问题的tif文件。从C#/编程的角度来看,这是一个很高的订单吗?
b
$
我意识到一半的战斗是创建一个虚假的设备管理器扫描器存根。如果它是一个疯狂的编程工作,我不确定我会想要接受它,但我想我会问。我不确定是否有任何Windows exe可以为我做这个
或许呢?我甚至研究过Android应用程序,也许使用我的手机或平板电脑,这是不行的。如果有人有任何建议/信息,将不胜感激!!!!



Right now one of the products I support at work is scanning software. My company is too cheap (unfortunately) to buy us all scanners. We have to scrounge around for one and see if someone has one that they are not using at the moment (at their desk). I have brought up having the concept of a lab where people can test things out and they look at me like I am an alien from another planet. :-) Okay, to end around this because I am so fed up I was thinking I would write some code to simulate a scanner and perhaps pass a tif file that I know will reproduce the issue. Is that a tall order from a C#/programming perspective?

I realize that half the battle is creating a faux device manager scanner stub. If it is going to be an insane programming effort I am not sure I would want to take it on but thought I would ask. I am not sure if there are any windows exe's that could do this now for me perhaps? I even looked into Android apps and perhaps using my phone or tablet and that was a no go. If anyone has any advice/info it would be greatly appreciated!!!!


推荐答案

您可以为Windows创建虚拟扫描程序,但不能在。净。 Windows驱动程序必须用C ++或C编写,因为这是内核可用的唯一运行时。但这样做需要合理的开发努力。有一个虚拟的
TWAIN 扫描仪,您可以下载并发布以进行测试。我从来没有使用它,但它可能适合你。

You can create a virtual scanner for Windows but not in .NET. Windows drivers have to be written in C++ or C as that is the only runtime available to the kernel. But doing this would require a reasonable amount of dev effort. There is a virtual TWAIN scanner that you can download and issue to test against. I've never used it but it might work for you.

我不知道拥有虚拟驱动程序会解决任何问题。这取决于你试图复制的问题,但很多问题可能与正在使用的扫描仪或驱动程序有关,因此创建虚拟的问题不会证明
或反驳任何问题。您似乎应该要求其中一个扫描仪可供您的支持团队使用,以便您可以共享该扫描仪。这似乎可以解决您的问题。

I don't know that having a virtual driver would solve anything though. It depends upon what problem you're trying to replicate but a lot of the issues is probably related to the scanner or driver that is being used so creating a virtual one wouldn't prove or disprove anything. It seems like you should request that one of the scanners be made available to your support team such that you can share that scanner. This seems like it would solve your issue.

但是,如果您支持贵公司编写的与扫描仪通信的软件,那么我倾向于在代码中使用接口允许您切换到更可调试的格式。对于您的客户,将使用常规扫描程序,但是对于您的
自己的开发,您可以接受传入的任何内容并将其发送到您想要的任何地方,包括文件系统,具体取决于您的需要。这有助于缩小应用程序的问题,而不是将正确的数据发送到扫描仪。然而,对于扫描仪/驱动程序特定的问题,它仍然无法帮助b $ b。

If, however, you're supporting software that your company has written that talks to a scanner then I'd lean toward using an interface in code to allow you to switch to a more debuggable format. For your clients the regular scanner would be used but for your own development you could take whatever is passed in and send it anywhere you want including to the file system, depending upon your needs. This would help narrow down issues with your application not sending the correct data to the scanner. It still would not help with scanner/driver-specific issues however.

Michael Taylor

http://www.michaeltaylorp3.net

Michael Taylor
http://www.michaeltaylorp3.net


这篇关于使用C#代码和Visual Studio创建一个虚拟扫描程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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