讀取 QR 碼型別
using IronQr;
using System.Drawing;
using System.Linq;

// Import an image containing a QR code
var inputImage = Image.FromFile("sample.jpg");

// Load the asset into a QrImageInput object
var imageInput = new QrImageInput(inputImage);

// Create a QR Reader object
var reader = new QrReader();

// Read the input and get all embedded QR codes
IEnumerable<QrResult> results = reader.Read(imageInput);

// Display the type of the first QR code found
Console.WriteLine($"The QR type is {results.First().QrType}");
NuGet Download
PM > Install-Package IronQR
讀取 QR 碼型別

讀取 QR 碼型別

使用IronQR輕鬆驗證QR Code的格式,以智能化處理多種不同格式的QR Code作為輸入。 IronQR 通過 QrResult.QrType 曝露檢測到的符號學,提供應用程式所需的資訊,以根據其格式驗證、路由或記錄掃描到的程式碼。

閱讀QR Code型別的5步指南

  • using IronQr;
  • QrImageInput imageInput = new QrImageInput(Image.FromFile("sample.jpg"));
  • QrReader reader = new QrReader();
  • IEnumerable<QrResult> results = reader.Read(imageInput);
  • Console.WriteLine($"The QR type is {results.First().QrType}");

程式碼說明

包含QR Code的圖像從磁碟中載入並包裝在 QrImageInput 物件中。 QrReader 實例掃描輸入並返回QrResult 物件的集合,每個檢測到的QR Code都有一個。 在結果上存取 QrType 時,返回識別檢測到的符號學的字串,例如標準的QR Code或其他支持的格式。

探索如何使用IronQR閱讀QR Code型別。

準備好開始了嗎?

Nuget Downloads 80,612版本:2026.11剛剛發布