在c#winform中使用带有水晶报告的条形码扫描器 [英] using barcode scanner in c#winform with crystal report

查看:137
本文介绍了在c#winform中使用带有水晶报告的条形码扫描器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

过度查看为什么以及我想要创建的内容。

基本上我只是手动存储条形码,产品名称和成本,另一方面(使用winform中的crystalreport)检测扫描仪和每个更精简的条形码scane,它应该在报告中添加其成本,产品名称并从数据库中删除特定记录。

问题....

1).i知道如何操纵使用crystalreport的数据库,但问题是我不知道如何告诉我的项目使用什么命名空间或库检测条形码扫描器。

2).2如何通过条形码扫描执行(数据恢复)执行将其添加到报告及其成本和产品名称,并从数据库中删除该特定记录。

由于ima新生婴儿对条形码的东西,任何形式的帮助都表示赞赏。





问候.....

解决方案

不确定你真的需要水晶报告来完成这项任务,但这取决于你。



说到条形码扫描仪,你通常有两种类型。



1. HID类型

在这种情况下条形码扫描仪枚举为HID设备,如鼠标和键盘。

这意味着扫描的任何数据都将显示在活动输入控件中,可能是记事本,Windows窗体或Web中的文本框页面。

要控制数据的去向,你需要确保你的控制是集中的。

有很多方法可以解决这个问题,但这不是一篇文章而已快速回答。



2. COM端口类型

这可以是模拟虚拟COM端口或扫描仪的USB扫描仪一个RS232端口。

无论哪种方式,您都需要从特定的COM端口读取数据,例如COM4。



此类型需要编码,但它也为您提供最佳控制。

要从串行端口读取数据,请使用类 SerialPort [ ^ ]。

然后可以将读取的数据放入 TextBox 或你想要使用的任何控件。



有很多关于如何使用这个类的例子:

MSDN:SerialPort简要示例 [ ^ ]



初学者C#中的串行通信 [ ^ ]



我希望这些信息可以帮助你转发项目

Over view why and what i m trying to create.
Basically i m trying simply to store bar code,product name and cost manually and on other hand (using crystalreport in winform) detect scanner and on each leaner barcode scane,it should add its cost,product name in report and delete particular record from database.
problem....
1).i know how to manipulate database using crystalreport but the problem is dont know how i can i tell my project to detect barcode scaner using what namespaces or libraries.
2).2nd how to get (data recived) scanned through barcode to perform adding it to report with its cost and product name and delete that particular record from database.
Since i m a new born baby to barcode thing any kind of help is appreciated.


Regards.....

解决方案

Not sure that you really need crystal report for this task, but that is up to you.

When it comes to barcode scanners, you usually have two types.

1. HID type
In this case the barcode scanner enumerates as a HID device, such as mouse and keyboard.
This means that whatever data is scanned will appear in the active input control, may that be Notepad, a text box in a Windows form or web page.
To control where the data is going you need to make sure your control is focused.
There are ways around this, but that is a matter for an article not a quick answer.

2. COM port type
This can be a USB scanner that emulates a virtual COM port or a scanner that has an RS232 port.
Either way, you need to read data from a specific COM port, such as COM4.

This type requires a bit of coding, but it also gives you the best control.
To read data from a serial port you use the class SerialPort[^].
The read data can then be put into a TextBox or whatever control you want to use.

There are plenty of examples out there for how to use this class:
MSDN: SerialPort brief Example[^]

Serial Comms in C# for Beginners[^]

I hope this info will help you forward in your project.


这篇关于在c#winform中使用带有水晶报告的条形码扫描器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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