IRONSOFTWAREHOME
讀取 QR 碼內容
using IronQr;
using System.Drawing;

// Import image
var inputImage = Image.FromFile("sample.jpg");

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

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

// Read the Input an get all embedded QR Codes
IEnumerable<QrResult> results = reader.Read(imageInput);

// Display the value of the first QR code found
Console.WriteLine($"QR code value is {results.First().Value}");
Imports IronQr
Imports System.Drawing

' Import image
Dim inputImage As Image = Image.FromFile("sample.jpg")

' Load the asset into QrImageInput
Dim imageInput As New QrImageInput(inputImage)

' Create a QR Reader object
Dim reader As New QrReader()

' Read the Input and get all embedded QR Codes
Dim results As IEnumerable(Of QrResult) = reader.Read(imageInput)

' Display the value of the first QR code found
Console.WriteLine($"QR code value is {results.First().Value}")
NuGet Download
PM > Install-Package IronQR
讀取 QR 碼內容

讀取 QR 碼內容

輕鬆提取QR Code的內容作為一個隨時可用的字串,讓您可以立即顯示其值給使用者、將其儲存到資料庫中,或者將其傳遞給其他函式。 IronQR使用Value屬性來公開這些資料。

讀取QR Code值的五步指南

  • using IronQr;
  • QrImageInput imageInput = new QrImageInput(Image.FromFile("sample.jpg"));
  • QrReader reader = new QrReader();
  • IEnumerable<QrResult> results = reader.Read(imageInput);
  • Console.WriteLine(results.First().Value);

程式碼說明

一個包含QR Code的圖像從磁碟載入並包裝在一個QrImageInput物件中,這告訴IronQR要掃描什麼。 一個QrResult物件的集合,每個在圖像中找到的QR Code對應一個物件。 在結果上呼叫.Value可以直接獲得解碼的字串,無論它是一個URL、一個產品ID,或是任何其他編碼文字。

探索如何使用IronQR讀取QR Code值。

準備好開始了嗎?

Nuget Downloads 74,386版本: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天試用金鑰
無需信用卡或帳戶建立