Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7982021
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T10:33:11+00:00 2026-06-04T10:33:11+00:00

I have this weird requirement to access scanner, barcode reader, camera etc. from an

  • 0

I have this weird requirement to access scanner, barcode reader, camera etc. from an asp.net application. Since these are local resources, i know its not possible to do that. I was wondering if there is some other solution to this problem.

I was thinking of creating an windows service that will run on local system and will open a port and listen to it and does the required job. I was wondering if there is a way to send some kind of message to the local port from an asp.net page using JS or some other library or activex.

If you have totally different solution, i am all ears.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T10:33:13+00:00Added an answer on June 4, 2026 at 10:33 am

    We solved an analogous problem (ticket printer attached to serial port) by creating a tiny app (TCL/TK original, as it runs nicely on Win/Mac/Lin, but C#/.NET now since mono grew up), that

    • takes the user/password
    • creates the session with a web request.
    • opens the browser,
    • giving the session token in the URL as an anchor (http[s]://foo.bar/baz?x=y#sessiontoken)

    This way it is never transmitted over the wire, but is available to the JS code in the client.

    After the helper app has started the browser, it uses long polling and the session token (known to the browser and the helper app) to communicate with the webserver – as a client-sided app it can communicate with the peripherial quite naturally.

    100’s of 1000’s of tickets printed this way …

    Edit:
    Yes, I know this gets longer and longer, but I need (and was asked to) to elaborate.

    If you want to avoid going the ActiveX/Silverlight/whatever route, which I strongly suggest, you need 4 players:

    1. Webserver
    2. Browser
    3. Helper application (“Agent”)
    4. Device (Ticket printer, Barcode scanner, whatever)

    Your basic problem is, that 1. needs to talk to 4., but can’t. So you choose two parallell paths: Communication meant for the user is exchanged between server and browser, while communication meant for the device is exchanged between server and agent, the latter relaying it to the device (and ofcourse the other way round).

    The agent is a quite simple application, that talks to the device via the OS facilities (how exactly this is done ofcourse depends on the device), and talks to the webserver via HTTP requests.

    Depending, on which direction of information flow you need:

    • To facilitate information flow from the device to the server, simply
      have activity on the device trigger a webrequest. (Input device, e.g. barcode scanner)
    • To facilitate information flow from the server to the devide, use long polling. (Output device, e.g. ticket printer)
    • For both directions do both (Server-triggered input device, e.g. camera)

    Now the remaining problem is, how to correlate a human action in the browser with a device action – in short: How can the server send the ticket you chose in your browser to your ticket printer, not to whatever printer long-polls next.

    To solve this, using the session ID is a natural fit – but it requires to have the browser and the agent both know the same session ID. For this to happen, you need to communicate it from one to the other. Since you can’t communicate it from the browser to the agent (or this discussion would be moot), you need to communicate it the other way round – and the anchor in the URL is the vehicle to achieve this. You do the following:

    • User starts the agent (not the browser!) and enters his credentials
    • Agent calls sends a web request for a login to the server, and gets back a session token (please use some basic cryptography or go for HTTPS)
    • Agent then starts the browser (e.g. by executing cmd.exe /c start "http[s]://domain.tld/start.aspx?x=y#sessiontoken")
    • Since the session token is an anchor, it will not be sent over the wire, but will be available to the browser-sided code … Bingo!
    • Now the two parallell paths are open: The browser for the human requests, knowing the session token, and the agent now going into the modes described above,
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a kind of funny and weird requirement this time. I have my
For a scenario, I have a ASP.NET MVC application with URLs that look like
This is a weird requirement I have. I know even my question is quite
I have this very weird results when trying to fetch the AVG() field from
We have this really weird problem in a Web Application when using ActiveRecord 2.0
I have this weird failing coffeescript, from this demo . The demo code works
I have this weird gridview problem in .net, I haven't found what can be
I have this weird problem with setting up cookies with PHP. Everything worked fine
this seems to be weird but it really happened. I have this code working
This is very weird. I have the following code: Assert.AreEqual(new DateTime(2000, 1, 1), DateTime.ParseExact(2000,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.