Our Customers
Contact Us Email: support@barcodelib.com
Home > .NET Barcode > C# Barcode Generation Guide > C#.NET Code 2 of 5 Barcode Generator Library
Download Barcode for .NET Suite Trial

Code 2 of 5 C#.NET Barcode Generation DLL

Generate & Print Linear Barcode Code 2 of 5 in C#.NET Class
  • Powerful & mature .NET barcode encoding component used for Code 2 of 5 generation
  • Work perfectly with popular .NET development tools, like Microsoft Visual Studio (2005 and above supported)
  • Provide advanced C# barcode generation and printing features for Code 2 of 5
  • Generate Code 2 of 5 barcode in ASP.NET web solutions using C# class library
  • Generate & output Code 2 of 5 to common image files and byte stream objects
  • Support other popular 1d barcodes, like C# Code 128, Code 39, EAN-13, and UPC-A
Linear Code 2 of 5 C#.NET Barcode Introduction
Code 2 of 5, also known as standard 2 of 5 or industrial 2 of 5, is a numeric-only barcode symbology. It is mainly used in areas like airline ticket marking, warehouse sorting and photofinishing. Compared with other linear barcode, Code 2 of 5 is a relatively low-density barcode type, because it can only encode information in its bars and the spaces only exist as separators.
Besides, we also support high-density barcode generation in C#, like 2d barcode - C# QR Code.
How to Encode Code 2 of 5 Barcode Images in C#.NET Class?
  1. Add C#.NET barcode generator dll to your project reference.
  2. Add the same C#.NET barcode generator dll to your Toolbox item.
  3. You could generate Code 2 of 5 barcode with following sample C# codes.
     BarcodeLib.Barcode.Linear code25 = new BarcodeLib.Barcode.Linear();
code25.Type = BarcodeType.CODE2OF5;
code25.Data = "123456";

code25.BarColor = System.Drawing.Color.Black;
code25.BarWidth = 1;
code25.LeftMargin = 7;
code25.RightMargin = 7;

// You could also adjust other settings of Code 2 of 5, like image format, rotate, image size etc.

// Save barcode image into your system
code25.drawBarcode("c:/code25.png");

// Make Code 2 of 5 barcode & output to byte array
byte[] barcodeInBytes = code25.drawBarcodeAsBytes();

// Make Code 2 of 5 barcode to Graphics object
Graphics graphics = ...;
code25.drawBarcode(graphics);

// Make Code 2 of 5 barcode and output to HttpResponse object
HttpResponse response = ...;
code25.drawBarcode(response);

// Make created Code 2 of 5 barcode to Stream object
Stream stream = ...;
code25.drawBarcode(stream);
Above Free Code 2 of 5 sample codes are built in Visual C# 2005
How to Create Standard 2 of 5 Barcodes in C# ASP.NET Website?
  1. Add "Barcodelib.Barcode.ASP.NET.dll" to your web project.
  2. Add "Barcodelib.Barcode.ASP.NET.dll" to the VS Toolbox.
  3. Open the folder "barcode" and copy files "linear.aspx" & "linear.aspx.cs" to your web folder.
  4. Drag "LinearASPNET" from the Toolbox and drop it on the split part of your aspx page.
  5. Adjust barcode type to Code 2 of 5 in the Properties Window or generate a Code of 5 barcode with Code 2 of 5 C# Encoding Code.
After the installation of Code 2 of 5 barcode generation component, you could also generate a standard Code 2 of 5 in IIS.
How to Generate Code 2 of 5 Barcodes in C# WinForms Programs?
  1. Add "BarcodeLib.Barcode.WinForms.dll" to your web project.
  2. Add "BarcodeLib.Barcode.WinForms.dll" to your Visual Studio Toolbox.
  3. Drag LinearWinForm to your windows forms project.
  4. Adjust barcode type to Code 2 of 5 in the Properties Window or produce a Code 2 of 5 barcode with above Code 2 of 5 C# Encoding Code.
Other Barcode Types Suitable with C# Code 2 of 5 Barcode DLL
C# 1D Barcode Generation:
C# 2D Barcode Generation:
This barcode generator DLL is applicable to all the following linear barcodes: Codabar, Code 11, Code 2 of 5, Code 39, Code 93, EAN-8, EAN-13, Interleaved 2 of 5, ITF-14 (UPC Shipping Container Symbol), Code 128, EAN 128/GS1 128, MSI Plessey, Intelligent Mail, Planet, Postnet, RM4SCC (British Royal Mail), UPC-A, UPC-E.
This barcode generator SDK is applicable to all the following linear2D barcodes: Data Matrix, PDF 417, QR Code.





Provides High Quality Barcode SDK in .NET, Barcode SDK in ASP.NET, Barcode SDK in C#, Barcode SDK in VB.NET, Barcode SDK in Windows Forms, Code 2 of 5 SDK in .NET, Code 2 of 5 SDK in C#, Code 2 of 5 SDK in VB.NET, Code 2 of 5 SDK in ASP.NET, Code 2 of 5 Barcode SDKs in Windows Forms, SSRS, Crystal Reports, and RDLC Reports.