C#. QR Code Generator Data Encoding Tutorial

sample source code to input valid data and generate 2D QR Code images in C# .NET


C# QR Code Introduction

QR Code, also known as Denso Barcode, QRCode, Quick Response Code, is a kind of 2D (two dimensional) barcode widely used today.

C# QR Code barcode is .NET barcode generating SDK, which is a user-friendly, light weight barcode component for making QR Code barcodes in C#.NET Winforms application, C#.NET ASP.NET Web forms applications, C#.NET class and console applications. This document provides 100% C# source code to explain how to encode QR Code valid data with .NET Barcode suite using C# class.

OnBarcode C# Barcode Generator is designed to generate, create QR Code and other linear & 2d barcodes in Microsoft Word. Here are some more tutorials for C# QR Code generation concerning size & image setting.

How to generate, print barcode using .NET, Java sdk library control with example project source code free download:

Encode QR Code Valid Character in C#.NET

QR Code valid character set:

Numeric data

Alphanumeric data

Byte characters

Kanji characters

Encode Alphanumeric Character into QR Code Using C#.NET class

It allows encoding alphanumeric data, including digits 0 - 9; upper case letters A -Z; and nine other characters: space, $ % * + - . / : .

QRCode barcode = new QRCode();

barcode.Data = "OnBarcode";

barcode.DataMode = QRCodeDataMode.Alphanumeic;

barcode.Format = ImageFormat.Png;


Encode Numeric into QR Code Using C#.NET class

It allows encoding numeric data (digits 0 - 9).

QRCode barcode = new QRCode();

barcode.Data = "123456789";

barcode.DataMode = QRCodeDataMode.Numeric;

barcode.Format = ImageFormat.Png;


Encode Byte Characters into QR Code Using C#.NET class

It allows encoding byte data (default: ISO/IEC 8859-1).

QRCode barcode = new QRCode();

barcode.Data = "$ % * + - . / ";

barcode.DataMode = QRCodeDataMode.Byte;

barcode.Format = ImageFormat.Png;


Encode Kanji Characters into QR Code Using C#.NET class

It allows encoding Kanji characters. Please see SJIS (Shift JIS encoding): from ~9ddddd (Shift JIS 0x8140 ~ 0x9FFC and 0xE040 ~ 0xEBBF)

QRCode barcode = new QRCode();

barcode.Data = "~937727";

barcode.ProcessTild = True;

barcode.DataMode = QRCodeDataMode.Kanji;

barcode.Format = ImageFormat.Png;


Modify QR Code Valid Length in C#.NET

QR Code is variable-length 2-dimensional barcodes, the storage capacity see the table below:

Data Type Maximum Data Storage Capacity
Alphanumeric Data 4,296 characters
Numeric Data 7,089 characters
Byte Character 2,953 characters
Kanji Character 1,817 characters

The length of QR Code is determined by the length of encoding data, for example:

barcode.Data = "1"; // in 1-digit length

barcode.Data = "123456789"; // in 9-digit length

barcode.Data = "12345678901234567890"; // in 20-digit length

OnBarcode is a market-leading provider of barcode imaging generator, reader controls and components for ASP.NET, Windows Forms, WPF, as well Java, Android, iOS (iPhone, iPad) across all major enterprise development platforms. We provides comprehensive tutorials and how-tos for various linear, 2d barcode information, such as C# in ASP.NET, C# .NET, C# Barcode Encoding, C# Barcode Image, VB.NET in ASP.NET, VB.NET Winforms, VB.NET Barcode Encoding, Paint QR Bar Code in Java, Print QR Code in Software. OnBarcode barcode products are supported by RasterEdge ASP.NET Document Viewer, which supports ASP.NET PDF Viewer, ASP.NET MVC Document Viewer, ASP.NET PDF Editor, MVC PDF Viewer. And provide high quality C# Convert PDF to Tiff, C# Convert PDF to Word, C# Convert PDF to HTML, C# Convert PDF to Jpeg images, and their easy and simple documents, like C# PDF SDK, C# extract text from PDF, C# Compress PDF, Print PDF in C# and C# extract image from PDF.
Terms of Use | Privacy Policy
Copyright © OnBarcode.com . All rights reserved.