Barcode for ASP.NET > Generate Barcode in C#

How to Generate Barcodes in ASP.NET Using C#

Stream Barcode Images in ASP.NET Web Applications Using Free Visual C#.NET Class
Compatibility & Requirement
  • .NET Development Environments: Visual Studio 2005/2008/2010, .NET Version 2.0 or above, IIS (Microsoft Internet Information Services), C#.NET, VB. NET, or Borland Delphi
  • Compatible Projects Types: ASP.NET Web Site, ASP.NET Web Services, Class Library and Console Application
  • Compatible Operating Systems: Windows 2000, Windows XP, Windows Vista, Windows 2007, Windows Server 2003 and later versions
  • Minimum System Requirements: 500MHZ processor, 128MB RAM, 5MB available hard drive space
Test Environment
  • Microsoft Windows XP
  • Microsoft Visual Studio 2005
  • Visual C#.NET
KA.Barcode Generator for ASP.NET is a mature barcode SDK library that lets you print and stream dynamic linear and 2D barcode images in Microsoft Internet Information Services (IIS), ASP.NET websites or web applications in C#.NET IDEs. This walkthrough will show you how to generate barcodes for ASP.NET in Visual Studio by using free C#.NET Barcode Library with use-friendly interface.
This product is completely complied in the best C# programming code, which is compatible with commonly-used windows system. And C#.NET barcode generation sample code is provided for users. It is free to download this .NET Barcode Generation Control SDK trial version to test. It supports multiple linear and tow-dimensional barcodes generation.
How to Generate Barcodes in ASP.NET Using C#.NET
Download KeepAutomation Barcode Generator for ASP.NET and unzip it to create linear and 2D barcode images in Visual C# ASP.NET project. Barcode generation examples and tutorials are provided for implementers.
Method 1: Drag and Drop Barcode to Web Forms in C#.NET
  1. Download KA.Barcode for ASP.NET trial package.
  2. Open Microsoft Visual Studio.
  3. Create a web application using the installed project templates in C# projects.
  4. Add BarcodeControl to your Visual Studio Toolbox.
  5. Copy "barcode.aspx" and "barcode.aspx.cs" to the folder where you generate barcode.
  6. Drag and Drop BarcodeControl to the Source Window.
  7. Right click Default.aspx, view code, and change barcode properties with following C# code.
C# Sample code
     BarCode barcode = new BarCode();
barcode.Symbology = KeepAutomation.Barcode.Symbology.Code39ex;
barcode.CodeToEncode = "Code 39";
barcode.X = 1;
barcode.WideNarrowRatio = 3;
barcode.Y = 40;
barcode.I = 10;
barcode.TopMargin = 10;
barcode.BottomMargin = 10;
barcode.LeftMargin = 10;
barcode.RightMargin = 10;
barcode.DisplayText = true;
barcode.DisplayStartStop = true;
barcode.BarcodeUnit = KeepAutomation.Barcode.BarcodeUnit.Pixel;
barcode.Orientation = KeepAutomation.Barcode.Orientation.Degree90;
barcode.DPI = 72;
barcode.ImageFormat = ImageFormat.Png;
barcode.generateBarcodeToImageFile("C://barcode-code39ex-csharp.png");

Method 2: Build Click Event in Web Forms in C#.NET
  1. Open Microsoft Visual Studio.
  2. Create a web application using the installed project template in C# projects.
  3. Copy "barcode.aspx" and "barcode.aspx.cs" to the folder where you generate barcode.
  4. Add KeepAutomation.Barcode.Web.dll to the C# project reference.
  5. Drag and drop a button from the Toolbox to the form, and double-click the button.
  6. Select View Code at the Default.aspx.
  7. Copy the following sample code to your ASP.NET class project.
C# Sample code
     BarCode barcode = new BarCode();
barcode.Symbology = KeepAutomation.Barcode.Symbology.QRCode;
barcode.CodeToEncode = "325413";
barcode.X = 10;
barcode.Y = 10;
barcode.TopMargin = 10;
barcode.BottomMargin = 10;
barcode.LeftMargin = 10;
barcode.RightMargin = 10;
barcode.DisplayText = true;
barcode.DisplayStartStop = true;
barcode.BarcodeUnit = KeepAutomation.Barcode.BarcodeUnit.Pixel;
barcode.Orientation = KeepAutomation.Barcode.Orientation.Degree0;
barcode.DPI = 72;
barcode.ImageFormat = ImageFormat.Tiff;
barcode.generateBarcodeToImageFile("C://barcode-qrcode-csharp.tiff");

CompatibilityTest EnvironmentASP.NET C# BarcodingUsing C#Using VB.NETData Matrix for ASP.NETPDF417 for ASP.NETQR Code for ASP.NETmoreCodabar for ASP.NETCode 39 for ASP.NETCode 128 for ASP.NETEAN-8 for ASP.NETEAN-13 for ASP.NETEAN 128 for ASP.NETIntelligent Mail for ASP.NETInterleaved 2 of 5 for ASP.NETISBN for ASP.NETITF-14 for ASP.NETRM4SCC for ASP.NETUPC-A for ASP.NETUPC-E for ASP.NETmore
KeepAutomation provides complete barcode automation solutions for add barcode display 2-dimensional, barcode generation capacity api, and barcode mobile applications. We recommend the customers use high quality ASP.NET html5 document viewer, c# pdf sdk, C# merge PDF files, Split PDF in C#, C# View, edit PDF online , C# Convert PDF to Tiff, C# Convert PDF to text, txt, .net imaging sdk, C# PDF metadata edit from RasterEdge.com.