适用于 C# 的 .NET 条码读取器
sgcCapture 是适用于 C# 的 .NET 条码读取器:从图像、TIFF 和 PDF 文件读取 QR Code、Data Matrix、PDF417 和线性条码,扫描文档并解码实时摄像头画面。
using System;
using esegece.sgcCapture;
class Program
{
static void Main()
{
using (TsgcCaptureBarcodeReader oReader = new TsgcCaptureBarcodeReader())
{
// all 11 formats by default; here only the formats of the label
oReader.Formats = TsgcCaptureBarcodeFormats.cbfGS1_128 |
TsgcCaptureBarcodeFormats.cbfQRCode;
oReader.TryHarder = true;
// JPEG, PNG, BMP, TIFF and PDF files: every page is read
oReader.ReadFromFile("shipping-label.png");
for (int i = 0; i < oReader.Results.Count; i++)
{
TsgcCaptureBarcodeResult oResult = oReader.Results[i];
Console.WriteLine(oResult.Format + ": " + oResult.Text);
}
}
}
}> ReadBarcodes.exe
cbfQRCode: https://www.esegece.com/products/sgccapture/
cbfGS1_128: (01)09501101530003(17)271231(10)LOT42该程序基于 .NET 8 构建,在带有 GS1-128 条码和 QR Code 的运单标签上运行。