Generating Barcodes C Sharp Tutorial - ByteScout
Announcement
Our ByteScout SDK products are sunsetting as we focus on expanding new solutions.
Learn More Open modal
Close modal
Announcement Important Update
ByteScout SDK Sunsetting Notice
Our ByteScout SDK products are sunsetting as we focus on our new & improved solutions. Thank you for being part of our journey, and we look forward to supporting you in this next chapter!

Generating Barcodes C Sharp Tutorial

Generating barcodes in C# using BarCode Generator SDK is easy – use the following source code sample.

C#

using System;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;

using Bytescout.BarCode;

namespace Sample
{
   class Program
   {
       static void Main(string[] args)
       {
           // Create new barcode object for barcodes generating purposes
           Barcode barcode = new Barcode();

           // Set symbology for barcode generation (you may generate UPCA, Code 39, Code 128, QR Code, Datamatrix, EAN13 and lot of other barcodes)
           barcode.Symbology = SymbologyType.UPCA;

           // Set barcode value to encode into generated bar code image
           barcode.Value = "12345678901";

           // Save barcode to image
           barcode.SaveImage("result.png");

           // Show image in the default image viewer
           Process.Start("result.png");
       }
   }
}

Tutorials:

prev
next