与其他组件比较 A Comparison Between IronBarcode & QrCoder C# Jordi Bardia 已更新:七月 28, 2025 Download IronBarcode NuGet 下载 DLL 下载 Start Free Trial Copy for LLMs Copy for LLMs Copy page as Markdown for LLMs Open in ChatGPT Ask ChatGPT about this page Open in Gemini Ask Gemini about this page Open in Grok Ask Grok about this page Open in Perplexity Ask Perplexity about this page Share Share on Facebook Share on X (Twitter) Share on LinkedIn Copy URL Email article In this tutorial, we will compare two widely used C# libraries - IronBarcode and QrCoder - for working with QR codes and barcodes. Let's begin with a brief introduction to both libraries: IronBarcode IronBarcode is a library created and maintained by Iron Software that enables C# software engineers to read and write barcodes and QR codes in .NET applications and websites. It is available on NuGet for all .NET Frameworks and .NET Core Frameworks. IronBarcode requires only one line of code to read or write barcodes. QrCoder QRCoder is a simple C# library that allows you to create QR codes. It has no dependencies on other libraries and is available on NuGet in .NET Framework and .NET Core PCL versions. Both libraries should have the following main features: Scan QR code Scan barcode Generate QR code Generate barcode We will implement all of these features from both libraries and compare their performance. First, let's install both libraries in our Visual Studio project. Since both libraries have their own NuGet packages, we will install them via the NuGet Package Manager Console. Install IronBarcode To install IronBarcode, type the following command in the Package Manager Console: Install-Package BarCode This will install the IronBarcode library in our project. Installing IronBarcode Install QrCoder Type the following command in Package Manager Console: Install-Package QRCoder This will install the QrCoder library in our project. Installing QrCoder Now, we will generate our first QR code using both libraries. Generate QR codes using IronBarcode The following code will generate a QR code. using System; using System.Diagnostics; using IronBarCode; class Program { static void Main() { // Create a stopwatch to measure the execution time Stopwatch stopwatch = new Stopwatch(); stopwatch.Start(); // Generate a QR code var qrCode = QRCodeWriter.CreateQrCode("Iron Barcode Vs QrCoder"); // Save the generated QR code as a PNG file qrCode.SaveAsPng(@"D:\Barcode Images\QrCodeByIronBarcode.png"); // Stop the stopwatch and output the execution time stopwatch.Stop(); Console.WriteLine($"Execution Time: {stopwatch.ElapsedMilliseconds} ms"); } } using System; using System.Diagnostics; using IronBarCode; class Program { static void Main() { // Create a stopwatch to measure the execution time Stopwatch stopwatch = new Stopwatch(); stopwatch.Start(); // Generate a QR code var qrCode = QRCodeWriter.CreateQrCode("Iron Barcode Vs QrCoder"); // Save the generated QR code as a PNG file qrCode.SaveAsPng(@"D:\Barcode Images\QrCodeByIronBarcode.png"); // Stop the stopwatch and output the execution time stopwatch.Stop(); Console.WriteLine($"Execution Time: {stopwatch.ElapsedMilliseconds} ms"); } } Imports System Imports System.Diagnostics Imports IronBarCode Friend Class Program Shared Sub Main() ' Create a stopwatch to measure the execution time Dim stopwatch As New Stopwatch() stopwatch.Start() ' Generate a QR code Dim qrCode = QRCodeWriter.CreateQrCode("Iron Barcode Vs QrCoder") ' Save the generated QR code as a PNG file qrCode.SaveAsPng("D:\Barcode Images\QrCodeByIronBarcode.png") ' Stop the stopwatch and output the execution time stopwatch.Stop() Console.WriteLine($"Execution Time: {stopwatch.ElapsedMilliseconds} ms") End Sub End Class $vbLabelText $csharpLabel The Stopwatch instance is created to measure the execution time of the program to analyze the efficiency of the library. Generated Barcode from IronBarcode IronBarcode's Execution Time IronBarcode takes 3503 ms to generate and save a QR Code. IronBarcode's execution time for generating new Barcodes Create a QR code with QRCoder The following sample code will generate a QR code using QrCoder. using System; using System.Drawing; using QRCoder; class Program { static void Main() { // Initialize the QRCodeGenerator QRCodeGenerator qrGenerator = new QRCodeGenerator(); // Generate QRCodeData with specified error correction level QRCodeData qrCodeData = qrGenerator.CreateQrCode("Iron Barcode Vs QrCoder", QRCodeGenerator.ECCLevel.Q); // Create QRCode object QRCode qrCode = new QRCode(qrCodeData); // Convert QRCode to Bitmap Bitmap qrCodeImage = qrCode.GetGraphic(20); // Save the QR code as a PNG file qrCodeImage.Save(@"D:\Barcode Images\QrCodeByQrCoder.png"); } } using System; using System.Drawing; using QRCoder; class Program { static void Main() { // Initialize the QRCodeGenerator QRCodeGenerator qrGenerator = new QRCodeGenerator(); // Generate QRCodeData with specified error correction level QRCodeData qrCodeData = qrGenerator.CreateQrCode("Iron Barcode Vs QrCoder", QRCodeGenerator.ECCLevel.Q); // Create QRCode object QRCode qrCode = new QRCode(qrCodeData); // Convert QRCode to Bitmap Bitmap qrCodeImage = qrCode.GetGraphic(20); // Save the QR code as a PNG file qrCodeImage.Save(@"D:\Barcode Images\QrCodeByQrCoder.png"); } } Imports System Imports System.Drawing Imports QRCoder Friend Class Program Shared Sub Main() ' Initialize the QRCodeGenerator Dim qrGenerator As New QRCodeGenerator() ' Generate QRCodeData with specified error correction level Dim qrCodeData As QRCodeData = qrGenerator.CreateQrCode("Iron Barcode Vs QrCoder", QRCodeGenerator.ECCLevel.Q) ' Create QRCode object Dim qrCode As New QRCode(qrCodeData) ' Convert QRCode to Bitmap Dim qrCodeImage As Bitmap = qrCode.GetGraphic(20) ' Save the QR code as a PNG file qrCodeImage.Save("D:\Barcode Images\QrCodeByQrCoder.png") End Sub End Class $vbLabelText $csharpLabel QrCoder does not provide a built-in function to save the QR code as an image. However, we can save it by parsing the QrCoder into a Bitmap object. We can then save the QR code using the save function provided by Bitmap. QrCoder's generated barcode Qrcoder's Execution Time QrCoder takes 592 ms to generate and save a QR Code. The time that it took QrCoder to generate a new barcode Analysis The execution time taken by IronBarcode is 3503 ms, while QrCoder only takes 592 ms. This makes QrCoder faster than IronBarcode in terms of performance. Generating QR codes is much simpler in IronBarcode, as we only need to write two lines of code. With the QrCoder library, it takes five lines of code. IronBarcode also provides a built-in function to save generated QR codes in a file, while QrCoder does not. We have to create a bitmap object to save the QR code in a file. This requires us to create four objects to generate QR codes using QrCoder. We only need to create one object in IronBarcode to do the same thing. Next, we will generate barcodes using both libraries. Generate a Barcode using IronBarcode The following code will generate a barcode using IronBarcode: using IronBarCode; class Program { static void Main() { // Generate a barcode with Code128 encoding var barcode = BarcodeWriter.CreateBarcode("Iron Barcode Vs QrCoder", BarcodeEncoding.Code128); // Save the generated barcode as a PNG file barcode.SaveAsPng(@"D:\Barcode Images\BarcodeByIronBarcode.png"); } } using IronBarCode; class Program { static void Main() { // Generate a barcode with Code128 encoding var barcode = BarcodeWriter.CreateBarcode("Iron Barcode Vs QrCoder", BarcodeEncoding.Code128); // Save the generated barcode as a PNG file barcode.SaveAsPng(@"D:\Barcode Images\BarcodeByIronBarcode.png"); } } Imports IronBarCode Friend Class Program Shared Sub Main() ' Generate a barcode with Code128 encoding Dim barcode = BarcodeWriter.CreateBarcode("Iron Barcode Vs QrCoder", BarcodeEncoding.Code128) ' Save the generated barcode as a PNG file barcode.SaveAsPng("D:\Barcode Images\BarcodeByIronBarcode.png") End Sub End Class $vbLabelText $csharpLabel Generated barcode using IronBarcode The execution time taken to generate a barcode using IronBarcode is below: IronBarcode's Barcode generation time It takes 3756 ms or 3.76 sec to generate a barcode. Generate a barcode using QrCoder It's worth noting that the QrCoder library does not provide the functionality to create barcodes. Therefore, if you need to create barcodes, IronBarcode is the better option. With regards to QR code scanning, let's see which library is the best option. Read a QR Code using IronBarcode The following code will read a QR code using IronBarcode. using System; using IronBarCode; class Program { static void Main() { // Read QR code from an image file BarcodeResults results = BarcodeReader.Read(@"D:\Barcode Images\QrcodeByIronBarcode.png"); // Check if any QR codes are found if (results != null) { // Loop through each result and print extracted text foreach (BarcodeResult result in results) { Console.WriteLine("Extracted text from QR Code is: " + result.Text); } } } } using System; using IronBarCode; class Program { static void Main() { // Read QR code from an image file BarcodeResults results = BarcodeReader.Read(@"D:\Barcode Images\QrcodeByIronBarcode.png"); // Check if any QR codes are found if (results != null) { // Loop through each result and print extracted text foreach (BarcodeResult result in results) { Console.WriteLine("Extracted text from QR Code is: " + result.Text); } } } } Imports System Imports IronBarCode Friend Class Program Shared Sub Main() ' Read QR code from an image file Dim results As BarcodeResults = BarcodeReader.Read("D:\Barcode Images\QrcodeByIronBarcode.png") ' Check if any QR codes are found If results IsNot Nothing Then ' Loop through each result and print extracted text For Each result As BarcodeResult In results Console.WriteLine("Extracted text from QR Code is: " & result.Text) Next result End If End Sub End Class $vbLabelText $csharpLabel IronBarcode returns an Enumerable as a result of reading QR codes. We need to loop through the Enumerable to retrieve each result. This feature is beneficial for reading QR codes from a document or from an image that has more than one QR code. The time it takes IronBarcode to read/scan all QR codes from a document It takes 3136 ms or 3.1 seconds using IronBarcode. Read a QR Code using QrCoder The QrCoder Library does not provide the functionality for reading or scanning a QR Code. Read a Barcode using IronBarcode The following code will scan the barcode using IronBarcode. using System; using IronBarCode; class Program { static void Main() { // Read barcode from an image file BarcodeResults results = BarcodeReader.Read(@"D:\Barcode Images\BarcodeByIronBarcode.png"); // Check if any barcodes are found if (results != null) { // Loop through each result and print extracted text foreach (BarcodeResult result in results) { Console.WriteLine("Text Extracted from Barcode is: " + result.Text); } } } } using System; using IronBarCode; class Program { static void Main() { // Read barcode from an image file BarcodeResults results = BarcodeReader.Read(@"D:\Barcode Images\BarcodeByIronBarcode.png"); // Check if any barcodes are found if (results != null) { // Loop through each result and print extracted text foreach (BarcodeResult result in results) { Console.WriteLine("Text Extracted from Barcode is: " + result.Text); } } } } Imports System Imports IronBarCode Friend Class Program Shared Sub Main() ' Read barcode from an image file Dim results As BarcodeResults = BarcodeReader.Read("D:\Barcode Images\BarcodeByIronBarcode.png") ' Check if any barcodes are found If results IsNot Nothing Then ' Loop through each result and print extracted text For Each result As BarcodeResult In results Console.WriteLine("Text Extracted from Barcode is: " & result.Text) Next result End If End Sub End Class $vbLabelText $csharpLabel IronBarcode returns Enumerable as a result of reading barcodes. We need to loop through it to get each result. It is beneficial for reading Barcode from a document or image which have more than one barcode. The output generated by the above code is as: The time IronBarcode takes to scan a barcode contained in a PDF or an image Read a Barcode using QrCoder QrCoder Library does not provide the functionality of reading or scanning QR Code. Now, Let's discuss the license options of both libraries. Licensing Licensing for IronBarcode IronBarcode is free for development. However, It requires a license for deployment outside of the visual studio development environment. License price range from $liteLicense to $unlimitedLicense (USD). You can get a discount if you purchase the complete Iron Suite. Check out IronBarcode's [licensing page](/csharp/barcode/licensing/) for more information about available licenses. Licensing for QrCoder QrCoder is open source, hence does not require any licensing. You are free to use it in any type of environment. You can also contribute to its source code if you like open-source development. When to use QrCoder If we only need the functionality of generating QR codes, QRCoder is the best option to use as it is free to use and doesn't require any payment or subscription fees. When to use IronBarcode IronBarcode is a great option when we require functionalities beyond generating QR codes, such as: Reading single or multiple barcodes and QR codes from images or PDFs. Image correction for skewing, orientation, noise, low resolution, contrast, etc. Creating barcodes and applying them to images or PDF documents. Embedding barcodes into HTML documents. Styling barcodes and adding annotation text. QR code writing that allows adding logos, colors, and advanced QR alignment. Summary The table below compares both IronBarcode and QrCoder. Side-by-side comparison of IronBarcode and QrCoder Conclusion IronBarcode for .NET allows developers to read and write barcodes and QR codes in their .NET applications using just one line of code. The library supports most barcode and QR code standards, including 39/93/128, UPC A/E, EAN 8/13, and QR, among others. The library automatically pre-processes barcode images and offers correction for rotation, noise, distortion, and skewing to improve speed and accuracy. IronBarcode is compatible with 32- and 64-bit systems, all .NET languages, and a variety of platforms, including desktop, console, cloud, and mobile and web applications. It also allows developers to write barcodes and QR codes for PDF, JPG, TIFF, GIF, BMP, PNG, and HTML documents, and modify text color, size, rotation, and quality. The library is secure and does not use web services or send data across the internet. IronBarcode is available for a free trial and offers three licensing options, including a Lite version for individual use, a Professional package for teams of up to 10 developers, and an Unlimited package for companies. QRCoder is a C# .NET library that generates QR codes based on ISO/IEC 18004 without dependencies on other libraries. It offers several QR code rendering classes, including QRCode, ArtQRCode, AsciiQRCode, and others. However, not all renderers are available on all target frameworks, and the .NET Standard/.NET >=5.0 versions have some constraints. QRCoder is free and does not require licensing. IronBarcode is more versatile than QrCoder since it offers support for all .NET Framework versions, has a wider range of features, and provides SaaS and OEM Redistribution coverage. IronBarcode also provides comprehensive documentation and 24/7 support, while QRCoder does not. IronBarcode has a licensing fee, but it is reasonable considering the features and support it offers. IronBarcode is a library developed by Iron Software, which also offers other useful libraries, including IronPDF, IronXL, IronOCR, and IronWebScraper. Purchase the complete Iron Suite to get all five products at a remarkable discount. In summary, IronBarcode is best suited for those who need to work with both barcodes and QR codes and want to create a barcode generator, QR code generator, barcode reader, and QR code reader. On the other hand, QRCoder is suitable for those who only need to create a QR code generator. 请注意QrCoder is a registered trademark of its respective owner. This site is not affiliated with, endorsed by, or sponsored by QrCoder. All product names, logos, and brands are property of their respective owners. Comparisons are for informational purposes only and reflect publicly available information at the time of writing. 常见问题解答 如何在 C# 中生成 QR 码? 要在 C# 中生成 QR 码,你可以使用 QrCoder 库,这是一个简单且开源的库。另外,你可以使用 IronBarcode 来获得更高级的功能,如样式化 QR 码并将其集成到文档中。 使用 IronBarcode 相对于 QrCoder 有什么优势? IronBarcode 提供广泛的功能,如读取条形码和 QR 码、图像校正以及将条形码嵌入到 PDF 和其他文档中。它非常适合需要全面条形码和 QR 码操作的项目。 有没有免费的库可以在 C# 中生成 QR 码? 是的,QrCoder 是一个用于生成 QR 码的免费开源库。它不需要许可,使其成为简单 QR 码生成的高性价比选项。 我可以用 QrCoder 读取 QR 码吗? 不,QrCoder 不支持读取或扫描 QR 码。要读取 QR 码,你可以使用 IronBarcode,它提供此功能以及其他附加功能。 如何在 .NET 项目中安装 QR 码库? 你可以使用 NuGet 包管理器控制台,用命令 Install-Package QRCoder 安装 QrCoder。对于 IronBarcode,使用 Install-Package IronBarcode。 IronBarcode 和 QrCoder 之间的 QR 码生成执行时间有什么区别? QrCoder 更快,大约需要 592 毫秒来生成和保存一个 QR 码,而 IronBarcode 大约需要 3503 毫秒。但是,IronBarcode 提供了比单纯 QR 码生成更高级的功能。 IronBarcode 部署是否需要许可证? 是的,IronBarcode 部署在 Visual Studio 开发环境之外需要许可证。它提供不同的许可选项,包括 Lite、Professional 和 Unlimited 套餐。 IronBarcode 提供了哪些条形码处理的功能? IronBarcode 允许读取和写入条形码和 QR 码、图像校正、样式化选项,以及将条形码嵌入到例如 PDF 等文档中,使其成为条形码处理的综合工具。 对于简单的 QR 码生成,我应该选择哪个库? 对于简单的 QR 码生成,QrCoder 是一个合适的选择,因为它易于使用且有免费许可。然而,对于更高级的任务,推荐使用 IronBarcode。 我可以使用 C# 将 QR 码集成到 PDF 中吗? 是的,你可以使用 IronBarcode 将 QR 码集成到 PDF 中。它提供功能读取和写入 QR 码和条形码,并无缝地将其嵌入到文档中。 Jordi Bardia 立即与工程团队聊天 软件工程师 Jordi 最擅长 Python、C# 和 C++,当他不在 Iron Software 利用这些技能时,他就在游戏编程。分享产品测试、产品开发和研究的责任,Jordi 在持续的产品改进中增加了巨大的价值。多样的经验使他面临挑战并保持投入,他表示这是在 Iron Software 工作的最喜欢的方面之一。Jordi 在佛罗里达州迈阿密长大,并在佛罗里达大学学习计算机科学和统计学。 相关文章 已更新九月 25, 2025 How to Choose the Best Barcode Library in C# 在本指南中,我们将比较五个最广泛使用的 .NET 条形码库——IronBarcode、http://ZXing.Net、Aspose.BarCode、BarcodeLib 和 Dynamsoft Barcode Reader。 阅读更多 已更新七月 28, 2025 How to Scan Barcodes in ZXing For C# Developers The core image decoding library, JavaSE-specific client code, and the Android client Barcode Scanner are only a few of the modules that make up ZXing. Numerous more independent open-source projects are built upon it. 阅读更多 已更新八月 31, 2025 ZXing.org QR Code Library and IronBarcode: A Comprehensive Comparison ZXing是一个流行的开源库,用于生成和解码一维和二维条形码。 阅读更多 ZXing.org QR Code Library and IronBarcode: A Comprehensive ComparisonA Comparison Between ZXing Decoder ...
已更新九月 25, 2025 How to Choose the Best Barcode Library in C# 在本指南中,我们将比较五个最广泛使用的 .NET 条形码库——IronBarcode、http://ZXing.Net、Aspose.BarCode、BarcodeLib 和 Dynamsoft Barcode Reader。 阅读更多
已更新七月 28, 2025 How to Scan Barcodes in ZXing For C# Developers The core image decoding library, JavaSE-specific client code, and the Android client Barcode Scanner are only a few of the modules that make up ZXing. Numerous more independent open-source projects are built upon it. 阅读更多
已更新八月 31, 2025 ZXing.org QR Code Library and IronBarcode: A Comprehensive Comparison ZXing是一个流行的开源库,用于生成和解码一维和二维条形码。 阅读更多