How to Create QR Codes from Strings that Are Separated by Escape Key or Vbtab Key?


BarcodeBC > Articles > How to Create QR Codes from Strings that Are Separated by Escape Key or Vbtab Key?


Creating QR Codes from strings that are separated by Escape Key or vbTab Key is not particularly complicated, as long as you have the right QR Code generator. Please see details below.



How to Create QR Codes from Strings that Are Separated by Escape Key

Here's an example code in C# that uses BarcodeBC.com .NET Barcode Generator library to create QR Codes from strings separated by escape key.


using BC.NetWinBarcodeGeneratorTrial.All;
using System;

namespace QRCodeGenerator
{
    class Program
    {
        static void Main(string[] args)
        {
            // Input string separated by escape key
            string input = "Hello World!\u001B1234567890\u001B100.00";

            // Split input string by escape key
            string[] values = input.Split("\u001B");

            // Generate QR Code for each value
            foreach (string value in values)
            {
                Qrcode barcode = new Qrcode();
                barcode.SetData = value;
                barcode.SetEncodingMode = QrcodeEncodingMode.Automatic
                barcode.SetQrcodeVersion = QrcodeVersion.Version1;
                barcode.SetECL = QrcodeECL.LevelL;
                barcode.SetUOM = UnitofMeasurement.Pixel;
                barcode.Resolution = 72;
                barcode.SetWidth = 80;
                barcode.SetHeight = 80;
                barcode.SetRotation = Rotation.RotateDown;
                barcode.SetLeftSpace = 5;
                barcode.SetRightSpace = 5;
                barcode.SetTopSpace = 5;
                barcode.SetBottomSpace = 5;

                // Save QR Code image
                string filename = value + ".png";
                barcode.GenerateBarcode(filename);
                Console.WriteLine("QR Code generated for value: " + value);
            }
        }
    }
}

This code first takes an input string that is separated by escape key (\u001B). It then splits the input string into an array of values using the Split() method. For each value, a QR Code is generated using the BarcodeBC.com .NET Barcode Generator library. The QR Code is saved as a PNG image with the value as the filename. Finally, the program prints a message indicating that a QR Code has been generated for each value.

Note that you can customize the QR Code settings such as data encoding mode, error correction level, image size, and image resolution according to your needs.



How to Create QR Codes from Strings that Are Separated by Vbtab Key?

To create QR Codes from Strings that are separated by vbTab key using BarcodeBC.com .NET Barcode Generator, you can follow these steps.

1. Combine the strings using vbTab key as separator.


string combinedString = "String1" + vbTab + "String2" + vbTab + "String3";

2. Create a Qrcode object and set the data.


Qrcode barcode = new Qrcode();
barcode.SetData = combinedString;

3. Generate the barcode image.


barcode.GenerateBarcode("barcode.png");

This will generate a QR Code barcode image named "barcode.png" from the combined string, where each string is separated by vbTab key.

In summary, creating QR Codes from separated strings is straightforward if you have the right QR Code generator. Besides .NET Barcode Generator Library, we also provide .NET QR Code generator for PDF document.