How to integrate bar code scanner with asp.net application?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • padavalanaresh
    New Member
    • Oct 2010
    • 1

    How to integrate bar code scanner with asp.net application?

    Please tell me the process of integrating barcode scanner with the asp.net application in brief,where i need to generate barcode images and read the barcode and store im my database.....
    I am not getting how to start and how to integrate that barcode scanner with asp.net appliaction
    please help me out
  • Curtis Rutland
    Recognized Expert Specialist
    • Apr 2008
    • 3264

    #2
    Short answer, you can't.

    Long answer, you can't because ASP.NET executes on the SERVER, not the CLIENT. There's no way for you to interact with a barcode scanner on a client's machine with ASP.NET.

    Comment

    • danp129
      Recognized Expert Contributor
      • Jul 2006
      • 323

      #3
      You can do it if you can require your end users to have JavaScript enabled.

      If you can require that all your users use a scanner that will press return after entering the text, that will make life much easier as well, otherwise you'll be writing extra JavaScript.

      You will need to find a free or commercial control that can generate the types of bar codes you plan to use.

      Whenever the user has decided to start scanning, they will need to click a button. The button can either set focus on a input box on the same page or it can redirect you to a new page with an input box that is focused on page load.

      In either case, with a scanner that presses return for them, each scan should submit the form. When the page reloads, JavaScript should and automatically focus the input box again and be ready for another scan.

      If users do not have a scanner that presses return for them then it's pretty much the same but you will have to setup a timer to monitor the input box and write your own logic to determine if the user has scanned something.

      Most importantly, you will need to use a search engine and search for examples of anything you don't know how to do and make an solid effort to complete each task yourself before asking for help. Be sure to ask JavaScript questions in the JavaScript forum.

      Comment

      • Frinavale
        Recognized Expert Expert
        • Oct 2006
        • 9749

        #4
        JavaScript is bound by rules that dictate that it cannot access the operating system.

        Therefore, you cannot use JavaScript to access the drivers on the user's operating system to gain access to the barcode scanner.

        You could consider using Silverlight to try and solve your problem.

        -Frinny

        Comment

        • Curtis Rutland
          Recognized Expert Specialist
          • Apr 2008
          • 3264

          #5
          Silverlight is constrained by the same rules, Frinny. It lives inside a sandbox and isn't allowed to play with anything else. Even if you install it locally, it just has a bigger sandbox.

          Comment

          • Frinavale
            Recognized Expert Expert
            • Oct 2006
            • 9749

            #6
            See, I have read that too...and I have also read that you can break the sandbox rules but the browser first informs the user.

            The thing is that, when I was working with sockets (which breaks the sandbox rules), the only time I saw a warning was when I was using IE...FireFox just worked.

            -Frinny

            Comment

            • danp129
              Recognized Expert Contributor
              • Jul 2006
              • 323

              #7
              How are you guys typing messages? Your keyboard and mouse require drivers at the OS level to type and click hyperlinks!

              Honestly though you guys may be right about old tech that may have used COM ports which *MAY* have required special support in the application, however, any USB bar code reader that XP+ has built in HID support should work just fine, as well as any reader that attaches to an AT/PS2 port.

              The reader basically types the bar code it reads into whatever window has focus. If a text field has focus in that window then you will see what was scanned. If the reader passes a carriage return then it would submit a web form, if not then you can monitor the input box with JavaScript.

              Credit card readers are similar but I don't think they pass a return, instead control characters like */ or something, it's been a while since I've swiped one on a computer.

              Comment

              • cathyhill345
                New Member
                • May 2013
                • 2

                #8
                You can do the programmning yourself or use some 3-rd party barcode reading library.
                Last edited by Rabbit; May 14 '13, 03:25 PM. Reason: Link to commercial product removed per forum policy.

                Comment

                Working...