Java Barcode Generator, .NET Barcode Generator for C#, ASP.NET, VB.NET
HOME PURCHASE SITEMAP COMPANY

BarcodeLib.com Home > Knowledge > .NET Barcode > C# Barcode Generator

C# Barcode Generator - Generating Barcodes in C#, C# ASP.NET



This article introduces how to use Barcode for .NET component to generate barcodes in your Visual C# ASP.NET website, C# classes, and C# Windows applications.



C# Barcode Generator Introduction

BarcodeLib Barcode for .NET is the most flexible and powerful C#.NET Bar Code generator.

Download free evaluation version



C# Barcode Generator Supporting Symbologies



C# Barcode - Project Setup

  • To setup C# ASP.NET Website, C# Windows Application projects, just add BarcodeLib.Barcode.dll to your C# project reference.

 

C# Barcode - Generating Barcodes in C#.NET Class

   1:  BarcodeLib.Barcode.Linear.Linear barcode = new BarcodeLib.Barcode.Linear.Linear();
   2:  barcode.Type = BarcodeLib.Barcode.Linear.BarcodeType.CODE39;
   3:  barcode.Data = "123456789";
   4:  // other barcode settings.
   5:   
   6:  // save barcode image into your system
   7:  barcode.drawBarcode("c:/barcode.gif");

The above code is written in Visual C# 2005
  1. Create an linear barcode object (BarcodeLib.Barcode.Linear.Linear).

  2. Set barcode type to Code 39

  3. Set your encoded barcode value

  4. Draw barcode image into a GIF file

 

C# Barcode - Generating Barcode in ASP.NET Webstie

  1. Copy folder barcode from your downloaded Barcode for .NET trial package, to your IIS folder, e.g. C:\Inetpub.


  2. Create a new virtual directory barcode.


  3. Restart IIS.


  4. Test your installation, goto http://YourDomain:port/barcode/linear.aspx?Type=CODE39&Data=12345678


  5. To create barcode image in your ASP.NET application, you can pass the url to IMG tag src value. For example, <img src="http://YourDomain:port/barcode/linear.aspx?Type=CODE39&Data=12345678" />

 

C# Barcode - Generating Barcodes in Windows Applications

  1. Add Reference BarcodeLib.Barcode.dll to your project. Do not copy the dll to the bin directory, Visual Studio will do so, during project compilation time.
    1. In your .NET windows project, right click mouse over Refereces in your Solution Explorer window. Then click menu "Add Reference ...".
    2. Add BarcodeLib.Barcode.dll to your project.


  2. Add barcode library to your Visual Studio Toolbox.
    1. Open Toolbox in Visual Studio. Click menu View, and check submenu Toolbox.
    2. Right click Toolbox, click menu Choose Items...
    3. Goto .NET Framework Components tab.
    4. Check component LinearWinForm, and its namespace is BarcodeLib.Barcode.Linear
    5. If no component found, click Browse... button and select BarcodeLib.Barcode.dll file.


  3. Now you can see the component displayed on Toolbox. You can drag LinearWinForm on your form, change barcode setting through properties widnow.



Other Related Articles








   Copyright 2009 BarcodeLib.com. Provides High Quality C# Barcode, Barcode C#, C# Barcode Generator, C# ASP.NET Barcode Components. All rights reserved.