C# Code 128 Barcode Reader
.NET Code 128 Barcode Reader for .NET, C#, ASP.NET & VB.NET

Barcode Reader for C#.NET > How to read barcode in C#? > Scan, read, Code 128 barcodes in C#


  • 100% written in Visual C#.NET 2.0
  • Support .NET 2.0, 3.0, 3.5 and later version
  • Achieve fast reading speed
  • Support reading distorted Code 128 barcode images
  • Read Code 128 barcodes in any angles
  • Read multiple Code 128 barcodes in a single image file
  • Support GIF, JPEG, PNG & TIFF formats
This tutorial helps you implement high-performance Code 128 barcode scanning in your .NET projects. Learn how to read Code 128 barcodes using C# in ASP.NET, WinForms, WPF, VB.NET & Console Applications You will learn how to install the library, read Code 128 from files and streams, process ASCII data, read metadata, and improve recognition rates.

The KeepAutomation C# Code 128 Reader SDK is a high-performance linear and 2D barcode recognition library for the .NET platform. It delivers fast, accurate decoding for Code 128 barcodes across all .NET application types.

Download Code 128 Barcode Reader for .NET
We offer free download for KA.Barcode Reader for .NET. The free evaluation download package contains:
  • KeepAutomation.BarcodeReader.dll
  • End user license agreement, user manual and order page
Note that: Although we allow users to use this evaluation package free of charge persistently, our .NET Barcode Reader will decode the first character of a barcode symbology randomly.


Read Code 128 Barcodes in a C# Class

You can quickly decode Code 128 barcodes using the BarcodeScanner.Scan() method.
  1. Call the static Scan method
  2. Pass the image file path as the first parameter
  3. Specify BarcodeType.Code128 as the target barcode type
  4. Retrieve decoded results as a string array


Note
  • Check the returned array for valid decoded text
  • Confirm the output matches the original encoded data


Scan Code 128 Barcodes from Memory Streams

You can also read Code 128 barcodes directly from in-memory Stream objects, without saving to disk.



Scan Multiple Barcode Types at Once

You can scan Code 128 and other barcode formats in a single operation. Use BarcodeScanner.ScanInDetails() and combine barcode types.


Retrieve Scanned Code 128 Barcode Properties

You can extract complete metadata about Code 128 barcodes using the BarcodeDetail and Code128Props classes.

Core Information Available
  • Type: Confirms the barcode format is Code 128
  • GetMessage(): Raw decoded text
  • GetASCIITextMessage(): Formatted text with visible control characters
  • Rotation: Barcode rotation angle
  • X1, Y1, X2, Y2, X3, Y3, X4, Y4: Bounding coordinates
  • StartSet: Initial code set (A, B, or C)
  • IsMixSet: Indicates multiple code sets were used
  • Checksum: Validated checksum value (0 - 102)


Read & Process Code 128 ASCII Text in C#

Code 128 supports full 128 ASCII characters, including non-printable control characters. Example: Handle Carriage Return (CR)

Auto-Format Non-Printable Characters

Use GetASCIITextMessage() to automatically replace control characters with readable labels.


Code 128 Checksum Verification

Code 128 includes a mandatory check character for data integrity. The KeepAutomation Reader automatically validates the checksum.
  • Valid Code 128 data is returned only if checksum passes
  • Checksum is not included in the output text
  • The library verifies the checksum internally


Improve Code 128 Recognition Rate

You can enhance scanning success for low-quality or distorted images using these methods.


Adjust Image Zoom Ratio

Test different zoom factors to improve module recognition. Recommended range: 0.2F to 4.0F


Expand the Quiet Zone

Quiet Zone (blank margin) should be at least 10X the narrowest bar width. Remove borders or extra graphics near the barcode to reduce interference.
  • Ensure ideal module width ratio: 1:2:3:4
  • Provide a quiet zone of at least 10X
  • Test zoom values between 0.2F and 4.0F


Summary

The KeepAutomation C# Code 128 Reader SDK provides enterprise-grade scanning for all .NET environments. You can easily integrate it into ASP.NET, Windows Forms, WPF, VB.NET, and console applications. The library includes full checksum validation, ASCII control character handling, and tools to boost recognition.









Frequently Asked Questions

What does Code 128 text code refer to?

Code 128 is a high-density linear barcode. It can encode any character from the ASCII 128 set. And its high-density barcode capable of making it suitable for text, numbers, and special commands. Using KeepAutomation C# Code 128 Barcode Reader library, you can easily scan and decode Code 128 text codes from barcode image files in C# ASP.NET, MVC, Blazor, Windows Forms, Console, WPF applications.

How do you scan and read a Code 128 barcode?

A Code 128 barcode has four parts: start character, data characters, checksum digit, and stop character. To read it, use a barcode scanner or software to scan the image's target area, identify the four parts, and decode the barcode data. Using C# Code 128 Scanner component library, you can scan and recognize all Code 128 codes from image file in Visual Studio .NET projects.

Can standard barcode readers process Code 128?

Code 128 is universally supported. Most commercial barcode scanner devices, plus free or paid barcode scanner software, can read Code 128 barcodes from images or printed materials. Using C#/VB.NET Code 128 reader library, you can build your own Code 128 barcode reader on computer, iOS, Android phones using C# apps.

How to scan and decode a Code 128 barcode?

You can easily scan and decode Code 128 text (from images or printed materials) using a barcode scanner, a phone with a camera, or barcode software. Simply point a compatible barcode reader at the barcode, whether it's on a screen or printed material. Using C# Code 128 reader library, you can easily decode Code 128 text codes in C# class.

Can barcode scanner software display the Code 128 checksum digit?

The scanner's software uses the checksum to ensure a successful and accurate scan, but the final result delivered to your application is the pure data, excluding the checksum digit. barcode scanners don't return the Code 128 checksum character. Using C# Code 128 reader sdk library, you can easily scan and decode revified Code 128 text codes in C# ASP.NET, Windows applications.