Use ZenBarCode.dll to generate free barcode C#

How to Generate Bar Code in C#?

Generate bar code C#, Barcodes make doing business much more efficient for companies. Barcodes provide a method to track and store information about goods, from individual items to large stocks of thousands or even millions of items. They serve an important role and provide advantages compared with manually entering information

You don’t need to remember any details of products to view details or to sale that product. So, just generate a bar code and sale it just by scanning it.

Usually we store product IDs or any other unique information of Product like IMEI number e-t-c.

There are many libraries to generate bar code in C#. In this tutorial we’ll use Zen Bar Code DLL File to generate Bar Code.

Steps to Generate Bar Code in C#:

  1. First of all Download the ZenBarCode DLL file from this Link
  2. Go to your solution explorer and right click on References and select Add Reference.
  3. In Reference Manager window, click on Browse button. Select ZenBarCode.dll from file dialogue window. Click on OK Button.
  4. You will find the ZenBarCode Reference in Solution Explorer.
  5. Next step is to add your controls to your Form. We need to add a TextBox, PictureBox and Button control from Toolbox.
  6. We’ll enter out text which we want to encrypt into bar code in the text box.
  7. double click on the button to create onClick event. And the add the following code:
 string barCode = txtBarCode.Text;
            try
            {
                Zen.Barcode.Code128BarcodeDraw brCode = 
                Zen.Barcode.BarcodeDrawFactory.Code128WithChecksum;
                pictureBox1.Image = brCode.Draw(barCode, 60);
            }
            catch (Exception)
            {
              
            }

Now click on start button or press Ctrl+F5 key to run your program and enter some text in the textbox and click on generate button.

C# will encode your text into a bar code and display it on the picture box. Now you can print your bar code and try to scan it using any bar code scanner.

Printing Barcode:

Click on this Link to learn how to Print your generated bar code:

Watch full Video tutorial on YouTube: https://youtu.be/dojOKLaZSDw

Source Code:

14 Replies to “How to Generate Bar Code in C#?”

  1. I’m amazed, I must say. Rarely do I encounter a blog that’s both educative and entertaining, and let me tell you, you have hit the nail on the head. The problem is an issue that not enough folks are speaking intelligently about. Now i’m very happy that I came across this during my search for something concerning this.|

  2. I don’t unremarkably comment but I gotta tell thankyou for the post on this great one : D.

  3. Hi there, for all time i used to check web site posts here early in the morning, because i enjoy to gain knowledge of more and more.|

  4. Thank you for some other wonderful article. Where else may just anybody get that kind of information in such a perfect means of writing? I’ve a presentation next week, and I’m on the search for such information.|

  5. It’s appropriate time to make some plans for the future and it’s time to be happy. I’ve read this post and if I could I desire to suggest you few interesting things or suggestions. Maybe you could write next articles referring to this article. I desire to read more things about it!|

  6. Terrific article! That is the kind of information that are supposed to be shared around the web. Disgrace on Google for now not positioning this post upper! Come on over and discuss with my site . Thanks =)|

  7. This site was… how do you say it? Relevant!! Finally I’ve found something which helped me. Thanks a lot!|

  8. This is my first time go to see at here and i am really happy to read all at alone place.|

  9. “Hello! This post could not be written any better! Reading this post reminds me of my good old room mate! He always kept talking about this. I will forward this article to him. Fairly certain he will have a good read. Many thanks for sharing!”

  10. This is very attention-grabbing, You’re an overly professional blogger. I’ve joined your feed and look ahead to in search of more of your excellent post. Additionally, I’ve shared your website in my social networks!

Comments are closed.