IRONSOFTWAREHOME
异步读取条形码
using IronBarCode;

// Reading many images asynchronously using ReadAsync
string[] imagePaths = new string[] { "image1.png", "image2.png" };
var resultsAsync = BarcodeReader.ReadAsync(imagePaths, new BarcodeReaderOptions() { ExpectMultipleBarcodes = true });

// Reading many PDFs asynchronously using ReadPdfAsync
string[] pdfPaths = new string[] { "doc1.pdf", "doc2.pdf" };
var resultsPdfAsync = BarcodeReader.ReadPdfsAsync(pdfPaths, new PdfBarcodeReaderOptions() { ExpectMultipleBarcodes = true, Scale = 3, DPI = 300 });
Imports IronBarCode

' Reading many images asynchronously using ReadAsync
Dim imagePaths As String() = New String() {"image1.png", "image2.png"}
Dim resultsAsync = BarcodeReader.ReadAsync(imagePaths, New BarcodeReaderOptions() With {.ExpectMultipleBarcodes = True})

' Reading many PDFs asynchronously using ReadPdfAsync
Dim pdfPaths As String() = New String() {"doc1.pdf", "doc2.pdf"}
Dim resultsPdfAsync = BarcodeReader.ReadPdfsAsync(pdfPaths, New PdfBarcodeReaderOptions() With {.ExpectMultipleBarcodes = True, .Scale = 3, .DPI = 300})
NuGet Download
PM > Install-Package BarCode
异步读取条形码

异步读取条形码

我们可以使用BarcodeReader类读取条形码。 最简单的方法是使用BarcodeReader.Read方法。 IronBarcode还具有用于多线程异步编程的ReadAsync方法。

关键点

  • 同步与异步方法

  • Read方法在需要立即结果时是简单易用的,并且在主线程上被调用。

  • ReadAsync方法用于异步执行,允许程序在等待条形码读取完成时继续执行其他任务。

  • BarcodeReaderOptions

  • true,读取器将寻找图像中的多个条形码。

  • EnhanceAccuracy:提高精度,但速度降低。

  • SpeedUp:提高读取效率,这可能对快速处理大量图像有用。 然而,如果设置为true,这可能会降低精度。

探索异步和多线程条形码读取
在 GitHub 上查看

准备开始了吗?

Nuget Downloads 2,422,100版本:2026.9刚刚发布

Key in blue circle

立即获取免费的 30 天试用版密钥

Your trial license will be sent to your email address

无任何限制。100% 解锁。无需信用卡。

bullet_checked无需信用卡或创建账户无任何限制。100% 解锁。无需信用卡。
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronPDF
预约您的免费现场演示
Booking Badge

深受全球数百万工程师信赖

Iron Software 的客户徽标
获取您的无义务咨询
填写下面的表格或通过sales@ironsoftware.com
您的资料将始终保密。
深受全球数百万工程师信赖
Iron Software 的客户徽标
立即获取您的免费30 天试用密钥
无需信用卡或创建账户