Home > Net >  Help: input using VB6 or VB.NET for scanning guns daemon
Help: input using VB6 or VB.NET for scanning guns daemon

Time:09-21

For this program is not the active application, but can get scanner reads the content; And distinguish the keyboard input,
Bar code content for * KPE2191200001W *,
My BBS small white, new program; Asking our great god help,

CodePudding user response:

 
Private Sub Form1_Load (sender As Object, As EventArgs e) Handles MyBase. Load
InitSerialPort ()
End Sub


Dim strIncoming As String
Dim RS232 As SerialPort
Private Sub InitSerialPort ()


RS232=New SerialPort (" COM10 ", 9600, Parity. None, 8, 1)
If (Not RS232. IsOpen) Then
RS232. The Open ()
End the If
Dim td As Thread=New Thread (AddressOf serialPort1_DataReceived)
Td. The Start ()
End Sub

Private Sub serialPort1_DataReceived ()
While True


If RS232. BytesToRead & gt; 0 Then
StrIncoming=RS232. ReadExisting. ToString
RS232. DiscardInBuffer ()
Invoke (New EventHandler (AddressOf ForDisplay) receiving data function called '
End the If

End While
End Sub

Private Sub ForDisplay ()
ListBox1. Items. The Add (strIncoming) 'to a carriage return position number - 1
ListBox1. SelectedIndex=ListBox1. Items. The Count - 1
If ListBox1. Items. Count & gt; Then 1000
Me. The ListBox1. Items. The Clear ()
End the If
End Sub

CodePudding user response:

To distinguish the keyboard input to baidu again you

CodePudding user response:

To solve the problem of link https://blog.csdn.net/weixin_33691598/article/details/91659687
Reply your this post, because when I was 7 years use vs2005\vb.net wrote a similar program that was used easyhook (remember), already can't remember the code, and then use the IDE hard all don't know where to go, the code in the link, watched the roughly, seemingly as it was when I wrote about the same, but the most seduce me memories is: when I write the things fun,
那时,我们当地有个做郎酒的区域代理商遇到物流时候的大问题,一个集装箱过来,包装都差不多,标识是条码,必须用扫描枪去扫,才能分类,但扫描枪扫出来都是条码,不是商品的类别和价格,这老板头就大了,找了个打字部,把条码对应的商品属性打印出来,然后卸货时候,派个仓管在那儿扫,然后对应打印出来的卡片,然后指定仓库里的货位,基本就是全人工,而且最让他郁闷的是,到底这些货的统计,万一有人在里面做手脚,比如低价位的酒弄到高价位的货区去,他损失就大了(他必须按高价位付钱),而且效率很低,有时负责扫描的发卡的时候,卸货工就得扛着货物在那儿排队等着,现在回想那时,物流系统和品牌渠道系统可以说都没成熟的,当时凑巧他的一个门店经理跟我老婆是闺蜜,我那时还在政府部门上班,知道我能编点代码,就找到我了,那时我把电脑直接搬到他仓库现场开发了好几个小时,老婆抱着孩子跟她闺蜜一直在旁边陪我,最后效果:扫描枪扫描以后,直接商品所有属性全部出来,并且自动统计,当时,那老板就让门店经理给了我老婆一个信封,回家一看居然是2000元整,当时我正工资才1055.我们当时就去超市给孩子买了几件多美滋奶粉,印象极其深刻,结果还没完,后来这老板又托门店经理在快过年时候,给我送了2件红花郎和一件小郎酒(歪嘴郎)到家里来,放下就走了,头也不会,这个事件,让我印象太深刻了,看到这个贴,完全让我回忆起来,特此调侃下,

CodePudding user response:

Thank you two great god, and this little white look at first, there is a problem to consult a great god,

CodePudding user response:

Scanning gun points two modes, one kind is simulated keyboard, is a simulation of the serial port, simulation of the keyboard is plug and play, is a natural conflict with the keyboard, can't avoid 100%, because is to simulate the keyboard, how will conflict with the keyboard, because the program can't distinguish the keyboard and scanning gun, because they are both USB, sweep gun before our solution is to convert into analog serial form, the need to install driver, and then calling the driver DLL, is also very simple, so that we can accurately identify a serial port, program can write death, very convenient, but there's a problem is to sweep the gun manufacturers must provide support to simulate a serial port and shaul the son of a gun, usually sweep gun is support analog serial ports, some the scanning gun to save the cost of cheap may only support analog keyboard, there is no keyboard after changing analog serial port conflict, can avoid 100%, when the program is invoked analog serial DLL driver, the program need not is the application of the current activation, swept the gun driver to activate the program run,

CodePudding user response:

reference jhonsonzhang reply: 3/f
a first to solve the problem of link https://blog.csdn.net/weixin_33691598/article/details/91659687
Reply your this post, because when I was 7 years use vs2005\vb.net wrote a similar program that was used easyhook (remember), already can't remember the code, and then use the IDE hard all don't know where to go, the code in the link, watched the roughly, seemingly as it was when I wrote about the same, but the most seduce me memories is: when I write the things fun,
那时,我们当地有个做郎酒的区域代理商遇到物流时候的大问题,一个集装箱过来,包装都差不多,标识是条码,必须用扫描枪去扫,才能分类,但扫描枪扫出来都是条码,不是商品的类别和价格,这老板头就大了,找了个打字部,把条码对应的商品属性打印出来,然后卸货时候,派个仓管在那儿扫,然后对应打印出来的卡片,然后指定仓库里的货位,基本就是全人工,而且最让他郁闷的是,到底这些货的统计,万一有人在里面做手脚,比如低价位的酒弄到高价位的货区去,他损失就大了(他必须按高价位付钱),而且效率很低,有时负责扫描的发卡的时候,卸货工就得扛着货物在那儿排队等着,现在回想那时,物流系统和品牌渠道系统可以说都没成熟的,当时凑巧他的一个门店经理跟我老婆是闺蜜,我那时还在政府部门上班,知道我能编点代码,就找到我了,那时我把电脑直接搬到他仓库现场开发了好几个小时,老婆抱着孩子跟她闺蜜一直在旁边陪我,最后效果:扫描枪扫描以后,直接商品所有属性全部出来,并且自动统计,当时,那老板就让门店经理给了我老婆一个信封,回家一看居然是2000元整,当时我正工资才1055.我们当时就去超市给孩子买了几件多美滋奶粉,印象极其深刻,结果还没完,后来这老板又托门店经理在快过年时候,给我送了2件红花郎和一件小郎酒(歪嘴郎)到家里来,放下就走了,头也不会,这个事件,让我印象太深刻了,看到这个贴,完全让我回忆起来,特此调侃下,
实际上这样的机会不是人人都有的,我做零售那会也经常要统计数据,于是想做个程序,让数据统计轻松些,最后是做出来了,但已经不干那份工了,受不了丢东西的困扰,每个月总要自己倒贴一些钱,

CodePudding user response:

Pass by here, I hope you can find a good answer,,,
  • Related