Our Customers
Contact Us Email: support@barcodelib.com
Home > .NET Barcode Reader > How to Read & Decode Barcodes in C#, VB.NET, ASP.NET Projects
Download Barcode Reader for .NET Trial

How to Read Barcodes in .NET Barcode Reader

Scan & Read barcode images in Viusal C#.NET, VB.NET, ASP.NET applications
  • Integrate advaced barcode recognition features into Visual Studio .NET Framework 2.0 or above
  • Support reading linear & 2d barcode images for .NET, ASP.NET web, C#, VB.NET programs
  • Quick to scan & decode barcode images from JPEG, GIF, PNG, BMP, TIFF image file formats
  • Provide developer guide for how to read barcode images using C# & VB.NET class library
  • Professional .net barcode reading component dll having been in use since 2003
  • Decode main 2d barcode images in .NET, like QR Code, Data Matrix, PDF417, ect
  • Scan linear barcodes in .NET, like Codabar, Code 39(Ex), EAN-13, Interleaved 2 of 5, UPC-A, UPC-E
.NET Barcode Reader & Scanner Library Package
In the downloaded package of Barcode Reader for .NET, you may see:
  • BarcodeLib.BarcodeReader.dll - .NET Barcode Reader Library DLL for barcode image recognition.
  • demo_images - Contains several sample barcode images. You can add your own images to that folder, then run "runDemo.bat" to test. Or you may copy "demo_images" to C:\ drive. Then rename it as "images" and run "Demo.exe".
  • DeveloperGuide.html - Explains how to use this .NET Barcode Reader DLL.
  • LicenseAgreement.pdf - end user license agreement.
  • Purchase - Barcode Reader for .NET.html - Contains the link to buy Barcode Reader for .NET.
Please note that, the first character of barcode data scanned by the trial package will be a random character.
How to Install .NET Barcode Reader Control & DLL?
  • Installation requirement: Microsoft .NET Framework 2.0 or later versions should be installed firstly.
  • Add BarcodeLib.BarcodeReader.dll to your Visual Studio .NET project reference.
How to Read & Decode Barcode Images in VS C#.NET Projects?
Below are exsamples of using free C# codes to scan and decode barcodes in C#.NET applications. Code 128 amd QR Code barcodes recognition are depicted. You can also see other linear or 2d barcode reading tutorial.
     string[] results = BarcodeReader.read("c:/code128-barcode.gif", BarcodeReader.CODE128);

string[] results = BarcodeReader.read("c:/qrcode-barcode.gif", BarcodeReader.QRCODE);
The above free C# codes will respectively decode and output all Code 128 and QR Code barcodes in image files "code128-barcode.gif" & "qrcode-barcode.gif".
In addition, you can customize our .NET barcode reader component, to improve Code-128/GS1-128/EAN-128 barcode reading speed, when you are scanning large image size (like 4mb per image).
  1. Set maxOneBarcodePerPage to true, if there is maximum one barcode per image or per page in tiff or pdf document.
    If maxOneBarcodePerPage is true, the .net barcode reader library will stop scanning the barcode immediately, once detects one barcode.
    If maxOneBarcodePerPage is false (default value), the library will use total 5 algorithms and each will scan the whole image from 4 directions.

  2. Read the partial image instead of the whole file.
    If the barcode is always located one specified area in the image, you can set and let the library scan that area only. And it will reduce lots of scanning time, CPU and memory usage.
    You just specify the left top point and right bottom point of the area (the point X, Y values are expressed in percentage of the whole image, so image most left top point is (0%, 0%), and most right bottom point is (100%, 100%)).
The following C# code explains how to read top 20% and bottom 20% of a Code 128 image.
     OptimizeSetting setting = new OptimizeSetting();


ScanArea top20 = new ScanArea(new PointF(0.0F, 0.0F), new PointF(100.0F, 20.0F));

ScanArea bottom20 = new ScanArea(new PointF(0.0F, 80.0F), new PointF(100.0F, 100.0F));

List<ScanArea> areas = new List<ScanArea>();


string[] results = BarcodeReader.read("c:/code128-barcode.gif", BarcodeReader.CODE128, setting);
How to Read & Decode Barcode Images in VS VB.NET Projects?
Please use the following Visual Basic sample codes to read and scan barcode iamges in VB.NET applications. We take Code 128 amd QR Code as examples. You can also see other 1d or 2d barcode reading guide.
     Dim datas() As String = BarcodeReader.read("c:/code128-barcode.gif", BarcodeReader.CODE128)

Dim datas() As String = BarcodeReader.read("c:/qrcode-barcode.gif", BarcodeReader.QRCODE)
The above free VB.NET codes will respectively scan and output all Code 128 and QR Code barcodes in image files "code128-barcode.gif" & "qrcode-barcode.gif".
Beside, you can use the VB.NET demo code below to read top 20% and bottom 20% of a Code 128 image.
     Dim setting As OptimizeSetting = New OptimizeSetting()


Dim top20 As ScanArea = New ScanArea(New Drawing.PointF(0.0F, 0.0F), New Drawing.PointF(100.0F, 20.0F))

Dim bottom20 As ScanArea = New ScanArea(New Drawing.PointF(0.0F, 80.0F), New Drawing.PointF(100.0F, 100.0F))

Dim areas As List(Of ScanArea) = New List(Of ScanArea)


Dim datas() As String = BarcodeReader.read("c:/code128-barcode.gif", BarcodeReader.CODE128, setting)
How to Scan Other Supported Linear & 2D Barcode Images?
Supported 1D Barcodes:
Supported 2D Barcodes:
Scan .NET 1D Barcode Images: Codabar, Code 39, Code 128, Interleaved 2 of 5, EAN 8, EAN 13, UPC-A, UPC-E.

Scan .NET 2D Barcode Images: Data Matrix, PDF 417, QR Code.
BarcodeLib.com also provide ASP.NET, C# & VB.NET barcode image reading & decoding tutorial, please see:

.NET Barcode Scanner, ASP.NET Barcode Scanner, C# Barcode Scanner, VB.NET Barcode Scanner, .NET QR Code Scanner, ASP.NET QR Code Scanner, C# QR Code Scanner, VB.NET QR Code Scanner, .NET Data Matrix Scanner, .NET Code 39 Scanner, VS.NET Barcoding Tutorial, ASP.NET Barcoding Tutorial, Java Barcoding Tutorial.