Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP.Net and Barcode Scanner

Reply
Thread Tools

ASP.Net and Barcode Scanner

 
 
chris_gpf1@hotmail.com
Guest
Posts: n/a
 
      07-26-2007
Hi,
I'm working on a website where the user will have to scan a barcode
with a serial barcode scanner.

I get the scanner working and reading the barcode, but when I want to
write the string in a Textbox, it's not working. The Textbox remain
blank.

Here's the code:


WithEvents _comPort As New IO.Ports.SerialPort
Delegate Sub SetValue(ByVal barcode As String)

Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
' Initialize the scanner.
End Sub

Sub ShowValue(ByVal barcode As String)
TextBox1.Text = barcode
End Sub

Private Sub ReadBarcode(ByVal sender As Object, ByVal e As
IO.Ports.SerialDataReceivedEventArgs) Handles _comPort.DataReceived

Dim value As String
Dim targetMethod As Reflection.MethodInfo =
Me.GetType().GetMethod("ShowValue")
Dim deleg As SetValue =
DirectCast([Delegate].CreateDelegate(GetType(SetValue), Me,
targetMethod), _
SetValue)

value = _comPort.ReadLine
deleg.Invoke(value)
End Sub


Can somebody help me please!
Thanks

Chris

 
Reply With Quote
 
 
 
 
ThunderMusic
Guest
Posts: n/a
 
      07-26-2007
hi,
you seem to do everything server side... but I think what you want to
achieve should be done client-side. imagine if you were to start 2 clients
connected to the page, which one your server will send the text to? (both?)
and it would mean the scanner is plugged in your server, which may not be
what you want.

I think the solution will be to get the value using javascript... can
javascript interact with COM ports, not that I know of...

The solution you may have is to install certain drivers (some serial scanner
have) so the input from your scanner is translated as if it were typed on
the keyboard. Then you'd not have to worry anymore about your scanner.

I hope it helps

ThunderMusic

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> Hi,
> I'm working on a website where the user will have to scan a barcode
> with a serial barcode scanner.
>
> I get the scanner working and reading the barcode, but when I want to
> write the string in a Textbox, it's not working. The Textbox remain
> blank.
>
> Here's the code:
>
>
> WithEvents _comPort As New IO.Ports.SerialPort
> Delegate Sub SetValue(ByVal barcode As String)
>
> Protected Sub Page_Load(ByVal sender As Object, ByVal e As
> System.EventArgs) Handles Me.Load
> ' Initialize the scanner.
> End Sub
>
> Sub ShowValue(ByVal barcode As String)
> TextBox1.Text = barcode
> End Sub
>
> Private Sub ReadBarcode(ByVal sender As Object, ByVal e As
> IO.Ports.SerialDataReceivedEventArgs) Handles _comPort.DataReceived
>
> Dim value As String
> Dim targetMethod As Reflection.MethodInfo =
> Me.GetType().GetMethod("ShowValue")
> Dim deleg As SetValue =
> DirectCast([Delegate].CreateDelegate(GetType(SetValue), Me,
> targetMethod), _
> SetValue)
>
> value = _comPort.ReadLine
> deleg.Invoke(value)
> End Sub
>
>
> Can somebody help me please!
> Thanks
>
> Chris
>



 
Reply With Quote
 
 
 
 
chris_gpf1@hotmail.com
Guest
Posts: n/a
 
      07-27-2007
> The solution you may have is to install certain drivers (some serial scanner
> have) so the input from your scanner is translated as if it were typed on
> the keyboard. Then you'd not have to worry anymore about your scanner.
>
> I hope it helps


Thanks for the idea!

Did not found this option in the drivers but I made a program in
VB.Net that redirect the COMPort Input to keyboard and it's working
fine!

Chris

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Singapore Post 4-State Barcode Support & Postnet Barcode Recognition sherazam Java 0 05-24-2012 09:55 AM
Read Barcode from Specific Area of Img & Create Fixed Size Barcode sherazam Java 0 03-01-2011 08:12 AM
Aztec 2D Barcode Recognition Support is Added in Aspose.BarCode sherazam Java 0 09-16-2010 10:44 AM
Suppress keyboard, allow barcode scanner teddysnips@hotmail.com ASP .Net 5 09-05-2006 01:51 AM
Question about Barcode Scanner connection magicianstalk Computer Support 1 09-01-2004 04:15 PM



Advertisments