Online Guide

For Using BC.NetBarcodeGenerator.Code128
Generate Code 128 barcode to raster image files, Stream, Bitmap, Graphics, and HttpResponse in .NET, C#, VB.NET applications.

Guide Overview

It's easy to use our .NET Code 128 generator library (BC.NetBarcodeGenerator.Code128) to create and generate Code 128 barcode in your .NET/C#/VB.NET Class, Console Application, .NET Windows Forms, and ASP.NET web projects. Please firstly download and get the free trial library of our .NET Code 128 generator library (BC.NetBarcodeGenerator.Code128). And the only thing for integration is to add your Visual Studio .NET project reference to our .NET Code 128 generator library dll.

BC.NetBarcodeGenerator.Code128

PLEASE NOTE, our .NET Code 128 generator library (BC.NetBarcodeGenerator.Code128) only supports Code 128 barcode generation for C# & VB.NET applications. For all barcode symbologies, we provide BC.NetBarcodeGenerator.All and it supports the most popular linear barcodes and 2d barcodes.

On this page, we provide C# and VB.NET Class coding examples of how to use our .NET Code 128 generator library (BC.NetBarcodeGenerator.Code128) to create and generate Code 128 barcode and save Code128 barcode to a local raster image file and Bitmap object. In addition, you can also create and save Code 128 barcodes to Stream, Graphics, and HttpResponse in .NET applications.

In addition to generating barcodes in .NET Class, you can also generate Code 128 barcodes in .NET Windows Forms, ASP.NET Web Forms, and IIS applications in other ways. Please click to see details. Moreover, ASP.NET web project and .NET Windows Forms project demos are included in the free trial package of our .NET Code 128 generator library (BC.NetBarcodeGenerator.Code128). Please download a free trial to see more.


Code 128 Barcode Generator C# & VB.NET Class

1. This section shows how to create and generate Code 128 barcode to a local raster image file on your disk in ASP.NET C# and VB.NET Class. Our .NET Code 128 barcode generator supports Jpg, Jpeg, Tiff, Png, Bmp, and Gif formats. Please firstly add your ASP.NET project reference to our .NET Code 128 barcode generator (BC.NetBarcodeGeneratorTrial.Code128.dll).

Code 128 Barcode Generator C# Class

using System;
using System.Drawing;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BC.AspNetBarcodeGeneratorTrial.Code128;

namespace BCAspNetBarcodeGeneratorDemo
{
    public partial class _Default : Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
  
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            Code128 barcode = new Code128();
            barcode.SetType = LinearType.Code128;
            barcode.SetData = "WWW.BARCODEBC.COM";
            barcode.SetTextVisible = true;
            barcode.ApplyTilde = false;
            barcode.SetUOM = UnitofMeasurement.Pixel;
            barcode.SetRotation = Rotation.RotateDown;
            barcode.SetColor = System.Drawing.Color.DeepPink;
            barcode.SetFontColor = System.Drawing.Color.Chocolate;
            barcode.SetFont = new Font("Arial", 10f, FontStyle.Bold);
            barcode.SetDPI = 96;
            barcode.SetLeftSpace = 5;
            barcode.SetRightSpace = 5;
            barcode.SetTopSpace = 5;
            barcode.SetBottomSpace = 5;
            barcode.SetWidth = 300;
            barcode.SetHeight = 100;
            barcode.SetX = 1;
            barcode.SetY = 80;
            barcode.SetImageFormat = System.Drawing.Imaging.ImageFormat.Png;
            barcode.GenerateBarcode("F:\\test.png");

            //In addition to String, you can also output barcode to a Bitmap object, Stream object, Graphics object, HttpResponse object or byte array.
        }    
    }
}

Code 128 Barcode Generator VB.NET Class

Imports System
Imports System.Drawing
Imports System.Collections.Generic
Imports System.Linq
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports BC.AspNetBarcodeGeneratorTrial.Code128

    Public Partial Class _Default
        Inherits Page

        Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
        End Sub

        Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs)
            Dim barcode As Code128 = New Code128()
            barcode.SetType = LinearType.Code128
            barcode.SetData = "WWW.BARCODEBC.COM"
            barcode.SetTextVisible = True
            barcode.ApplyTilde = False
            barcode.SetUOM = UnitofMeasurement.Pixel
            barcode.SetRotation = Rotation.RotateDown
            barcode.SetColor = System.Drawing.Color.DeepPink
            barcode.SetFontColor = System.Drawing.Color.Chocolate
            barcode.SetFont = New Font("Arial", 10F, FontStyle.Bold)
            barcode.SetDPI = 96
            barcode.SetLeftSpace = 5
            barcode.SetRightSpace = 5
            barcode.SetTopSpace = 5
            barcode.SetBottomSpace = 5
            barcode.SetWidth = 300
            barcode.SetHeight = 100
            barcode.SetX = 1
            barcode.SetY = 80
            barcode.SetImageFormat = System.Drawing.Imaging.ImageFormat.Png
            barcode.GenerateBarcode("F:\test.png")
            
            ‘In addition to String, you can also output barcode to a Bitmap object, Stream object, Graphics object, HttpResponse object or byte array.

        End Sub
    End Class

2. These .NET Class coding examples show how to load an image and generate Code 128 barcode symbology on it in .NET WinForms application. Please firstly add your .NET WinForms project reference to our .NET Code 128 generator library (BC.NetBarcodeGeneratorTrial.Code128.dll). All barcodes properties reference is provided here.

Code 128 Barcode Generator C# Class

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using BC.NetWinBarcodeGeneratorTrial.Code128;

namespace BCNetWinBarcodeGeneratorDemo
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Code128 barcode = new Code128();
            barcode.SetType = LinearType.Code128;
            barcode.SetData = "WWW.BARCODEBC.COM";
            barcode.SetTextVisible = true;
            barcode.ApplyTilde = false;
            barcode.SetUOM = UnitofMeasurement.Pixel;
            barcode.SetRotation = Rotation.RotateDown;
            barcode.SetColor = System.Drawing.Color.DeepPink;
            barcode.SetFontColor = System.Drawing.Color.Chocolate;
            barcode.SetFont = new Font("Arial", 10f, FontStyle.Bold);
            barcode.SetDPI = 96;
            barcode.SetLeftSpace = 5;
            barcode.SetRightSpace = 5;
            barcode.SetTopSpace = 5;
            barcode.SetBottomSpace = 5;
            barcode.SetWidth = 300;
            barcode.SetHeight = 100;
            barcode.SetX = 1;
            barcode.SetY = 80;
            barcode.SetImageFormat = System.Drawing.Imaging.ImageFormat.Png;
            Image image = barcode.GenerateBarcode();
            pictureBox1.Image = image;

            //In addition to Bitmap object, you can also output barcode to a String, Stream object, Graphics object or byte array.
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            
        }
    }
}

Code 128 Barcode Generator VB.NET Class

Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Data
Imports System.Drawing
Imports System.Linq
Imports System.Text
Imports System.Windows.Forms
Imports BC.NetWinBarcodeGeneratorTrial.Code128

    Public Class BCNetWinBarcodeGeneratorDemo

        Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs)
            Dim barcode As Code128 = New Code128()
            barcode.SetType = LinearType.Code128
            barcode.SetData = "WWW.BARCODEBC.COM"
            barcode.SetTextVisible = True
            barcode.ApplyTilde = False
            barcode.SetUOM = UnitofMeasurement.Pixel
            barcode.SetRotation = Rotation.RotateDown
            barcode.SetColor = System.Drawing.Color.DeepPink
            barcode.SetFontColor = System.Drawing.Color.Chocolate
            barcode.SetFont = New Font("Arial", 10F, FontStyle.Bold)
            barcode.SetDPI = 96
            barcode.SetLeftSpace = 5
            barcode.SetRightSpace = 5
            barcode.SetTopSpace = 5
            barcode.SetBottomSpace = 5
            barcode.SetWidth = 300
            barcode.SetHeight = 100
            barcode.SetX = 1
            barcode.SetY = 80
            barcode.SetImageFormat = System.Drawing.Imaging.ImageFormat.Png
            Dim image As Image = barcode.GenerateBarcode()
            pictureBox1.Image = image

            ‘In addition to Bitmap object, you can also output barcode to a String, Stream object, Graphics object or byte array.

        End Sub  
    End Class


Do you use these words to search online and find our .NET Code 128 barcode generator library? For instance, .net code 128 generator, code 128 generator .net, c# code 128 generator, code 128 generator c#, code 128 barcode generator, code 128 barcode generator c#, code 128 barcode generator vb.net, code 128 barcode generator asp.net web, asp.net code 128 generator library, code 128 generator asp.net, vb.net code 128 generator library, code 128 generator vb.net, generate code 128 in c# windows application, generate barcode 128 c# windows application, generate barcode 128 c# web application, generate code 128 barcode c# web application, generate code 128 barcode c# windows application, create code 128 barcode c# web application, create code 128 barcode vb.net, generate code128 c#, c# generate code128 barcode, barcode 128 generator online, code 128 converter library, generate barcode online code 128, c# barcode 128 generator library, etc.




More Barcodes Generation Guide