How to Read a QR Code using IronBarcode

In this tutorial, we explore the use of the Iron Barcode library to read QR codes within a console application in Visual Studio. The process begins with the installation of the Iron Barcode library via NuGet Package Manager or console. Once installed, the library is imported into the program file. The tutorial walks through using the 'Quickly Read One Barcode' function of the Iron Barcode library, which requires the path of the QR code as an argument. A complex, blurry QR code is used as a test case to showcase the library's capabilities. Despite the complexity of the QR code, the Iron Barcode library successfully decodes it, demonstrating its efficiency and reliability. The decoded information is printed to the console using the Console.WriteLine function. Additionally, the video emphasizes the versatility of the Iron Barcode library, which supports various QR code operations, including creating, formatting, and reading both QR codes and barcodes. The tutorial concludes by encouraging viewers to reach out to the support team for any further assistance, highlighting the library's comprehensive support service.

// This code demonstrates the use of the Iron Barcode library to read a QR code in a C# console application.
using IronBarCode;
using System;

class Program
{
    static void Main()
    {
        // Define the path to the QR code image.
        string qrCodePath = @"path\to\your\qrcode.png";

        try
        {
            // Utilize the Iron Barcode library's method to quickly read a QR code.
            // This method returns a BarcodeResult object.
            BarcodeResult result = BarcodeReader.QuicklyReadOneBarcode(qrCodePath);

            if (result != null)
            {
                // Output the decoded text to the console.
                Console.WriteLine("QR Code Decoded: " + result.Text);
            }
            else
            {
                Console.WriteLine("No QR code found.");
            }
        }
        catch (Exception ex)
        {
            // Log any exceptions that occur during the QR code reading process.
            Console.WriteLine("An error occurred: " + ex.Message);
        }
    }
}
// This code demonstrates the use of the Iron Barcode library to read a QR code in a C# console application.
using IronBarCode;
using System;

class Program
{
    static void Main()
    {
        // Define the path to the QR code image.
        string qrCodePath = @"path\to\your\qrcode.png";

        try
        {
            // Utilize the Iron Barcode library's method to quickly read a QR code.
            // This method returns a BarcodeResult object.
            BarcodeResult result = BarcodeReader.QuicklyReadOneBarcode(qrCodePath);

            if (result != null)
            {
                // Output the decoded text to the console.
                Console.WriteLine("QR Code Decoded: " + result.Text);
            }
            else
            {
                Console.WriteLine("No QR code found.");
            }
        }
        catch (Exception ex)
        {
            // Log any exceptions that occur during the QR code reading process.
            Console.WriteLine("An error occurred: " + ex.Message);
        }
    }
}
' This code demonstrates the use of the Iron Barcode library to read a QR code in a C# console application.
Imports IronBarCode
Imports System

Friend Class Program
	Shared Sub Main()
		' Define the path to the QR code image.
		Dim qrCodePath As String = "path\to\your\qrcode.png"

		Try
			' Utilize the Iron Barcode library's method to quickly read a QR code.
			' This method returns a BarcodeResult object.
			Dim result As BarcodeResult = BarcodeReader.QuicklyReadOneBarcode(qrCodePath)

			If result IsNot Nothing Then
				' Output the decoded text to the console.
				Console.WriteLine("QR Code Decoded: " & result.Text)
			Else
				Console.WriteLine("No QR code found.")
			End If
		Catch ex As Exception
			' Log any exceptions that occur during the QR code reading process.
			Console.WriteLine("An error occurred: " & ex.Message)
		End Try
	End Sub
End Class
$vbLabelText   $csharpLabel

Further Reading: How to Read a QR Code using IronBarcode

Jordi Bardia
Software Engineer
Jordi is most proficient in Python, C# and C++, when he isn’t leveraging his skills at Iron Software; he’s game programming. Sharing responsibilities for product testing, product development and research, Jordi adds immense value to continual product improvement. The varied experience keeps him challenged and engaged, and he says it’s one of his favorite aspects of working with Iron Software. Jordi grew up in Miami, Florida and studied Computer Science and Statistics at University of Florida.
< PREVIOUS
How to Create Barcodes in ASP .NET with IronBarcode

Ready to get started? Version: 2025.6 just released

View Licenses >