读取条形码的应用程序,其中包含控制字符/不可见字符。(使用c#和wpf) [英] Application to read barcode which has control characters/invisible characters in it.(using c# and wpf)

查看:248
本文介绍了读取条形码的应用程序,其中包含控制字符/不可见字符。(使用c#和wpf)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

< span style ="font-size:medium"> 

要求: -

Requirement:-

创建Windows应用程序以读取条形码中包含控制字符/不可见字符。(使用c#和wpf)

  ;

我附上了一个示例解决方案 我试过但我有以下问题: -

 

该解决方案适用于没有控制字符的条形码,也适用于具有ESC或Enter作为控制字符的条形码。

但对于控制字符,如
[TAB],[SHIFT],[DEL],[BACKSPACE] ,它无法正常工作。

But for control characters like [TAB] , [SHIFT] , [DEL] ,[BACKSPACE] it doesn’t works correctly.

 

< span style ="font-size:medium">例如: -

  ;

如果我手动输入:
1234 [ALT ] 009 [RELEASE ALT] 5678 [ENTER]
:模拟隐形字符

If I manually put : 1234[ALT]009[RELEASE ALT]5678[ENTER]: simulates the invisible character

但是如果我尝试通过条形码阅读相同的内容(查看条形码的附件),整个事情就会被清除掉。 (签入样本解决方案)

But  if I try reading the same via bar code(see attachment for bar code) the entire things gets cleared out. (Check in sample solution)

当我试图找出原因时结束,我发现" PreviewTextInput "事件不会针对隐形字符(标签控件)引发。

When I tried to figure out the reason on my end,  I found ‘PreviewTextInput’ event is not raised for the invisible character(tab control).

 

请任何人都可以建议一个替代解决方案或在我分享的解决方案中做出哪些更改,所以

我实现了所需的功能。

示例解决方案和条形码图像

DotNetTeamX

DotNetTeamX

推荐答案

条形码扫描器是一种输入设备。

A barcode scanner is an input device.

就像一个keyboarr。

Like a keyboarr.

如果你有一个条形码你需要做的就是扫描它并输入字符转到任何一个控件有焦点,就像你输入它们一样。

If you have a barcode all you need to do is scan it and it inputs the characters go to whichever control has focus, just like you typed them.

为了应对标签等,有时需要做一些配置。

There is sometimes some configuration to do in order to cope with tabs etc.

还有一些特殊设备,例如仓库扫描仪,用于存储数据供以后下载到电脑。

And there are some exceptional devices eg warehouse scanners intended to store data for later download to a pc.


这篇关于读取条形码的应用程序,其中包含控制字符/不可见字符。(使用c#和wpf)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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