Our Customers
Contact Us Email: support@barcodelib.com
Home > .NET Barcode > VB.NET Barcode Generation Guide > VB.NET Code 128 Barcode Library for .NET WinForms, ASP.NET
Download Barcode for .NET Suite Trial

VB.NET Code 128 Barcode Generator Control

How to Use Visual Basic/VB.NET to Generate Code 128 Barcode Images in .NET Programs
  • Add mature barcode capabilities like barcode image generation and printing supports to .NET Framework-based applications
  • With easy-to-use design, no need for any special or complex configurations for using this VB.NET Barcode Class Library DLL
  • Compiled fully in Visual C#.NET with 100% compatiblity with Visual Studio .NET Framework
  • Directly use .NET Barcode Generator SDK barcoding functions for linear Code 128 barcode generation
  • Generate & print Code 128 1D barcode for ASP.NET, .NET WinForms, .NET Class Library, etc
  • Generate & draw linear Code 128 barcode images on SQL Server Reporting Services for .NET projects
  • Insert & draw Code 128 images on Crystal Reports and RDLC Reports for .NET projects
  • All encoded Code 128 barcodes comply with its latest barcode standards, compatible with almost all printers
  • Provide several license types for ordering this professional Visual Basic Barcoding Component for .NET
VB.NET Code 128 Barcode Image Overview
Linear barcode Code 128 is still called USS Code 128, Code 128 Code Set A, Code 128 Code Set B, Code 128 Code Set C, ANSI/AIM 128, ANSI/AIM Code 128, Uniform Symbology Specification Code 128, Code 128A, Code 128B, Code 128C.
ISO/IEC Standard Compatibility: Complying with ISO/IEC 15417 (Second edition 2007-06-01)
Code 128 Three Code Sets
  • Code Set A (or Chars Set A): all of the standard upper case U.S. alphanumeric keyboard characters and punctuation characters together with the control characters, (i.e. characters with ASCII values from 0 to 95 inclusive), and seven special characters.
  • Code Set B (or Chars Set B): all of the standard upper case alphanumeric keyboard characters and punctuation characters together with the lower case alphabetic characters (i.e. characters with ASCII values from 32 to 127 inclusive), and seven special characters.
  • Code Set C (or Chars Set C): the set of 100 digit pairs from 00 to 99 inclusive, as well as three special characters. This allows numeric data to be encoded as two data digits per symbol character, at effectively twice the density of standard data.
Code 128 Special Characters
The last seven characters of Code Sets A and B (character values 96 - 102) and the last three characters of Code Set C (character values 100 - 102) are special non-data characters with no ASCII character equivalents, which have particular significance to the bar code reading device.
Guide to Create Code 128 Barcode in Visual Basic .NET Class

How to Install

  1. Add VB.NET barcode library dlls to your VB.NET application reference.
    • Click "Project" and select "Add Reference...".
    • Click "Browse" to find Barcodelib.Barcode.ASP.NET.dll or BarcodeLib.Barcode.WinForms.dll in the unzipped file, and click "OK" button.
  2. Add VB.NET barcode library dlls to Visual Studio Toolbox.
    • Right click in Toolbox and select "Choose Items...".
    • In the pop-up "Choose Toolbox items" window, click "Browse..." to select either BarcodeLib.Barcode.WinFroms.dll or Barcodelib.Barcode.ASP.NET.dll.
    • Click "OK" and now four items are listed in VS Toolbox, for example: LinearWinForm, DataMatrixWinForm, PDF417WinForm, and QRCodeWinForm. And now it's done!

How to Implement

Please use the free VB sample code below to generate a Code 128 barcode image in .NET Framework Class Library.
     Dim code128 As New BarcodeLib.Barcode.Linear()
code128.Type = BarcodeType.CODE128
code128.Data = "BarcodeLibCODE128"

code128.AddCheckSum = True
code128.UOM = UnitOfMeasure.PIXEL

' Set Code 128 barcode image size and quiet zones.
code128.BarWidth = 1
code128.BarHeight = 78
code128.LeftMargin = 11
code128.RightMargin = 11
code128.ImageFormat = System.Drawing.Imaging.ImageFormat.Png

' More Code 128 barcode settings here, like image color, font, human-readable text font etc.

' save barcode image into your system
code128.drawBarcode("c:/code128.png")

' Encode Code 128 barcode & output to byte array
byte[] barcodeInBytes = code128.drawBarcodeAsBytes()

' Encode Code 128 barcode to Graphics object
Graphics graphics = ...
code128.drawBarcode(Graphics)

' Encode Code 128 barcode and output to HttpResponse object
HttpResponse response = ...
code128.drawBarcode(response)

' Encode Code 128 barcode and output to Stream object
Stream stream = ...
code128.drawBarcode(stream)
Above Code 128 sample code is coded in Visual Basic
Guide to Generate Code 128 Barcode Image in VB.NET ASP.NET Web Programs
We provide detail user guide for how to generate Code 128 barcode iamges in ASP.NET, please see as blow (Two Methods Provided).
  1. VB.NET Code 128 barcode generation through BarcodeLib Buildin ASP.NET Barcode Application.
    • Unzip the downloaded evaluation package, and copy barcode folder and its contents to your IIS folder, eg. C:\inetpub.
    • Create a new virtual directory in your IIS, name it "barcode", and connect it to the above "barcode" folder in inetpub.
    • Restart IIS for a Code 128 streaming test. Simply navigate to:
      http://YourDomain:port/barcode/linear.aspx?Type=2&Data=CODE128&LeftMargin=10&RightMargin=10
      Above is the encoded Code 128 barcode image. If you want to customize Code 128 image width & height, please view more web stream URL parameters for Code 128 here: .NET Code 128 Barcode Property Settings.
    • You can also insert this Code 128 image in your aspx or html page, simply pass the url to IMG tag or src value.
      For example:
      <img src=http://YourDomain:port/barcode/linear.aspx?Type=2&Data=CODE128&LeftMargin=10&RightMargin=10 />
      This method will not generate any barcode images in your IIS server side.
  2. VB.NET Code 128 barcodes encoding through ASP.NET Web Form Controller.
    • Intall ASP.NET barcode controller to your barcoding project by adding reference.
    • Add barcode library to your Visual Studio toolbox.
    • Open barcode in your unzipped trial package, and copy files "linear.aspx", "linear.aspx.cs" to the aspx page where you will be generating Code 128 images.
    • Now you can drag LinearASPNET to your ASP.NET web site, and change Code 128 settings through properties window on the right.
    • Run the project and a Code 128 barcode is generated on your aspx pages.
    • Or you may directly generate Code 128 barcodes using above free sample Visual Basic .NET code for your ASP.NET applications.
Guide to Generate Code 128 Barcode Image in VB.NET Windows Programs
  1. Add reference to BarcodeLib.Barcode.WinForms.dll to your barcoding project.
  2. BarcodeLib.Barcode.WinForms.dll to your Visual Studio toolbox.
  3. You can simply drag the LinearWinForm to your windows form, and a Code 128 barcode is generated.
  4. Or you may directly create Code 128 barcodes using above free sample Visual Basic .NET code for your .NET Windows Forms applications.
Code 128 VB.NET Barcode Generator Component Supported Barcodes
VB.NET Linear Barcodes:
VB.NET Matrix Barcodes:
VB.NET Code 128 Barcode Component Supported 1D (Linear) Barcodes: Codabar, Code 11, Code 2 of 5, Code 39, Code 93, Code 128, EAN 8, EAN 13, EAN 128, Interleaved 2 of 5, ITF14 (UPC Shipping Container Symbol), MSI Plessey, OneCode, Planet, Postnet, RM4SCC (British Royal Mail 4-State Customer Barcode), UPC-A, UPC-E.
VB.NET Code 128 Barcode Component Supported 2D (Matrix) Barcodes: Data Matrix, PDF417, QR Code.