如何在c#.net应用程序中使用扫描仪

发布于 2024-09-03 03:28:44 字数 148 浏览 5 评论 0原文

我有一个条形码扫描仪(Symbol-ls2208),但我不知道如何将信息从它读取到我的应用程序(在 C# 中)。谁能用示例代码帮助我解决这个问题?

操作系统:Windows XP。 扫描仪:Symbol LS2208 通用条形码扫描仪

Geetha。

I have a barcode scanner(Symbol-ls2208) but i dont know how to read information from it to my application (in C#). Can anyone help me in this problem with sample code?

Os: Windows XP.
scanner: Symbol LS2208 General Purpose Bar Code Scanner

Geetha.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

所谓喜欢 2024-09-10 03:28:44

您有什么类型的条码扫描仪?通常这些扫描仪与键盘楔一起使用,这意味着它们将逐字“键入”扫描仪通过操作系统的键盘处理系统读取的字符。在这种情况下,您无需执行任何特殊操作即可获取信息。

如果情况并非如此,您应该提供更多信息。什么样的扫描仪,以及什么样的连接?您使用什么操作系统?

编辑

根据Symbol关于LS2208的信息,它有以下几种连接方式:

支持的接口:IBM、键盘
楔形、RS-232、Synapse、USB、Wand

这是一个非常简单的模型,我认为它没有任何内存,因此它总是将条形码直接发送到连接的计算机。

您使用什么界面?您是否实际测试过使用该设备进行扫描?只需打开文本编辑器并扫描一些内容即可。条形码应该出现在您的屏幕上。根据提供的手册,您可以在代码后添加 LF。因此,您将能够在应用程序中使用文本框并检查 Enter 键。

Edit2

一个小代码示例。将一个名为 TextBox1 的文本框添加到您的表单中,并向其中添加以下事件处理程序:

private void TextBox1_KeyDown(object sender, KeyEventArgs e)
{
    if (e.KeyCode == Keys.Enter)
    {
        // Do your thing with the supplied barcode! 
        e.Handled = true;
    }
}

您需要将扫描仪配置为在扫描后提供换行/回车符才能正常工作。

编辑3

要配置扫描仪,您确实需要检查提供的信息。我找到了 快速参考指南,甚至还有配置实用程序来执行此操作。使用这两个你应该能够弄清楚。由于我没有 LS2208,因此我无法为您提供更多帮助。

好的,也许是 LS2208 一般支持下载页面的链接。是否 此链接有效吗?

What type of barcode scanner do you have? Usually those scanners work with a keyboard wedge, meaning they will literally 'type' the characters the scanner reads through the keyboard handling system of your OS. In that case, you don't have to do anything special to get the information.

If that is not the case, you should supply some more information. What kind of scanner, and with what sort of connection? What OS are you using?

Edit:

Well according to Symbol's information about the LS2208, it has the following connection methods:

Interfaces supported: IBM, Keyboard
wedge, RS-232, Synapse, USB, Wand

It is a very simple model, and I think it does not have any memory so it will always send the barcode directly to the connected computer.

What interface do you use, and have you actually tested scanning with the device? Just open a text editor and scan something. The barcode should appear on your screen. With the supplied manual you can make it add a LF after the code. So you will be able to use a TextBox in your application and check for the Enter-key.

Edit2:

A small code sample. Add a TextBox called TextBox1 to your form and add the following event handler to it:

private void TextBox1_KeyDown(object sender, KeyEventArgs e)
{
    if (e.KeyCode == Keys.Enter)
    {
        // Do your thing with the supplied barcode! 
        e.Handled = true;
    }
}

You will need to configure the scanner to supply a line feed/carriage return after a scan for this to work.

Edit3:

To configure the scanner you really need to check the supplied information. I found a Quick Reference Guide, and even a configuration utility to do so. You should be able to figure it out using those two. Since I do not own a LS2208, I can't help you any further than that I think.

Okay perhaps a link to the general support download page for the LS2208. Does this link work?

写给空气的情书 2024-09-10 03:28:44

我知道已经晚了,但请查看此链接。

使用此扫描仪的最佳方法是使用 Windows SDK 并将其作为 USB 设备连接。然后您可以根据事件使用扫描仪,效果很好!比键盘挂钩更快、更可靠。它们有一个可以静默安装的驱动程序集,以及用于访问所有内容的 .NET 程序集。

http://support.symbol.com/support/search.do?cmd=displayKC&docType=kc&externalId=14978401apdf&sliceId=&dialogID=265730457&stateId=1%200%20265720256

I know its late, but check out this link.

The best way to go with this scanner is use the windows SDK and connect to it as a USB device. Then you can work with the scanner on an event basis, which works well! Quicker and more reliable than keyboard hooks. They have a driver set that can be silently installed, and .NET assemblies to access it all.

http://support.symbol.com/support/search.do?cmd=displayKC&docType=kc&externalId=14978401apdf&sliceId=&dialogID=265730457&stateId=1%200%20265720256

秋日私语 2024-09-10 03:28:44

您可能需要某种驾驶员交互模块。您是否获得过 .NET 程序集或其他接口组件?一旦您拥有某种接口组件,解决方案通常是查找它的文档,并根据需要连接您的软件......

You will probably need some kind of driver-interaction module. Have you been given a .NET assembly or other interfacing component? Once you have some sort of interfacing component, the solution is usually to look in the documentation for it, and connect up your software as required...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文