QR Code Image Sample - pqScan.com
C#, VB.NET Barcode Creator Encoding Barcode Image in C# and VB.NET Online Demo Download Trial Purchase Now

How to Generate Barcode Image

back to home  >  .NET Barcode Scanner SDK  >  Generate Barcodes in C# & VB.NET

How to Generate Barcode in C# and VB.NET

As a managed .NET library, pqScan Barcode Creator can be used in both C# and VB.NET language. It can run standalone without other component to encode and make barcode images fast and good quality. In addition, it's easy to integrate into any .net programming, such as Console application, .NET Winforms and ASP.NET web sites.

What's more, pqScan Barcode Creator SDK is a multifunctional component, it includes an ASP.NET barcode generating control, a Windows Forms barcode generating control and an API. If you have interest in the barcode generating control, you can see another two barcode creating guide. Here, we will introduce you how to use API to encode and make barcodes in C# and VB.NET.

Encode barcode with 1D type - C Sharp sample

The first guide will show you how to make Linear(1D) barcode in C# code. As we know, pqScan Barcode Creator provides generating Generate Code 128, Generate Code 39, Generate UPC-A, Generate EAN8, Generate EAN13 barcodes. Here we choose Code-128 for example.

using System;
using PQScan.BarcodeCreator;

namespace BarcodeGeneratorInCSharp
{
    class Program
    {
        static void Main(string[] args)
        {
            Barcode barcode = newBarcode();

            barcode.Data = "www.pqscan.com";
            barcode.BarType = BarCodeType.Code128;
            barcode.Width = 300;
            barcode.Height = 100;

            barcode.CreateBarcode("code128-csharp.jpeg");
        }
    }
}

Encode barcode with 2D type - Visual Basic sample

The second tutorial shows how to print 2D barcode in VB.NET code. Here we choose creating QR Code for example. As long as QR Code, PDF417, Aztec Code and Data Matrix can be generated using VB.NET, too.

Imports System.IO
Imports PQScan.BarcodeCreator

Namespace BarcodeGeneratorVB
    Class Program
        Private Shared Sub Main(args As String())
            Dim barcode As New Barcode()

            barcode.Data = "www.pqscan.com"
            barcode.BarType = BarCodeType.QRCode
            barcode.Width = 200
            barcode.Height = 200

            barcode.CreateBarcode("qrcode-vb.jpeg")
        End Sub
    End Class
End Namespace
.NET Barcode Creator QR Code Creator in C#/VB Data Matrix Creator in C#/VB PDF 417 Creator in C#/VB Aztec Creator in C#/VB EAN 13 Creator in C#/VB EAN 8 Creator in C#/VB UPC A Creator in C#/VB Code 128 Creator in C#/VB Code 39 Creator in C#/VB