How to scan barcode in asp.net web application?

Question:

Hi,there, I'm asked to make as asp.net project with simple functions. It can allow users to upload barcode images(bmp, jpg, png, gif or tiff file), after that, users can decode the barcodes out, and show the results to the html page. Can you give us some recommendation using C# code?

---- Quincy

Answer:

Hi, Quincy.

To make things simple, you only need add two web controls into the aspx page. One is FileUpload control, the other is Button.

You can use the FileUpload control to upload the barcode image files in the asp.net application. In addition, you can insert a Image web control to the aspx page, after the barcode image uploaded, make this web Image control to display the barcode image dynamically. Please note, if you want to show this barcode image instant by ajax technique, you need use the UpdatePanel provided by Microsoft. Just insert the web Image into the UpdatePanel, the Image control can refresh immediately while the upload barcode image changed.

Then while you clicking the button, you can define the customized click event in the aspx.cs. Such as reading and scanning barcode feature can be added in this server side event.

Here we post the main sample C# code in the asp.net web page. You can make your own web application just like this. Please add the "PQScan.BarcodeScanner.dll" to your project reference.