Generate Barcode and QR Code in C#

In this tutorial we will see how to generate Barcode and QR Code using Zen Barcode Rendering Framework. So let's create this Windows Forms application:


Then then right click on the project and select Manage NuGet Packages..., and write zen barcode in Search and Zen Barcode Rendering Framework and install it.


Then in BarcodeButton click event write this code:

private void BarcodeButton_Click(object sender, EventArgs e)
{
    Zen.Barcode.Code128BarcodeDraw barcode = Zen.Barcode.BarcodeDrawFactory.Code128WithChecksum;
    pictureBox1.Image = barcode.Draw(textBox1.Text, 50);

}

And in QRCodeButton click event write this code:

private void QRCodeButton_Click(object sender, EventArgs e)
{
    Zen.Barcode.CodeQrBarcodeDraw qrcode = Zen.Barcode.BarcodeDrawFactory.CodeQr;
    pictureBox1.Image = qrcode.Draw(textBox1.Text, 50);
}

Now run the application and this is the output:



Check this video to understand more:




Generate Barcode and QR Code in C# Generate Barcode and QR Code in C# Reviewed by Bloggeur DZ on 10:25 Rating: 5

4 commentaires:

  1. Zen does not exist in the current context VS2015

    RépondreSupprimer
  2. I also share a Barcode Generator Example Projects, you can download the trial version of the barcode generator, which has demo Projects.It contains various barcode types which is very easy to use.

    RépondreSupprimer
  3. so easy, but how can i print it

    RépondreSupprimer
  4. Gives you the best website address I know there alone you'll find how easy it is. Bitcoin QR Code

    RépondreSupprimer

Fourni par Blogger.