IRONSOFTWAREHOME
读取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}");
Imports IronQr
Imports System.Drawing
Imports System.Linq

' Import an image containing a QR code
Dim inputImage As Image = Image.FromFile("sample.jpg")

' Load the asset into a QrImageInput object
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 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 轻松验证二维码格式,以实现智能处理。 IronQR通过QrResult.QrType公开检测到的符号编码,为应用程序提供根据格式验证、路由或记录扫描代码所需的信息。

读取二维码类型的 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码的图像从磁盘加载并包装在QrImageInput对象中。 QrResult对象的集合,每个检测到的QR码对应一个对象。 访问结果上的QrType将返回一个字符串,用于识别检测到的符号编码,如标准QR码或其他支持的格式。

了解如何使用 IronQR 读取 QR 码类型。

准备开始了吗?

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 天试用密钥
无需信用卡或创建账户