IRONSOFTWAREHOME
建立QR碼
using IronBarCode;

// The value of the QR code as a string. Also suitable for URLS
string value = "https://ironsoftware.com/";

// Simplest example of creating a QR Code with no settings
GeneratedBarcode myQRCode = QRCodeWriter.CreateQrCode(value);

// Advanced example with all parameters exclusive to QR codes set:

// The error correction level of the QR code
var correction = QRCodeWriter.QrErrorCorrectionLevel.Highest;

// The width and height of the QR code in pixels
int size = 500;

// QR version.
// Please read https://www.qrcode.com/en/about/version.html to learn more about what QR version is
int qrVersion = 0;

GeneratedBarcode myQRCodeComplex = QRCodeWriter.CreateQrCode(value, size, correction, qrVersion);
Imports IronBarCode

' The value of the QR code as a string. Also suitable for URLS
Dim value As String = "https://ironsoftware.com/"

' Simplest example of creating a QR Code with no settings
Dim myQRCode As GeneratedBarcode = QRCodeWriter.CreateQrCode(value)

' Advanced example with all parameters exclusive to QR codes set:

' The error correction level of the QR code
Dim correction = QRCodeWriter.QrErrorCorrectionLevel.Highest

' The width and height of the QR code in pixels
Dim size As Integer = 500

' QR version.
' Please read https://www.qrcode.com/en/about/version.html to learn more about what QR version is
Dim qrVersion As Integer = 0

Dim myQRCodeComplex As GeneratedBarcode = QRCodeWriter.CreateQrCode(value, size, correction, qrVersion)
NuGet Download
PM > Install-Package BarCode
建立QR碼

建立QR碼

IronBarcode為開發者提供直觀且易於使用的方法來建立具有多種自定義選項的獨特QR碼。 無論您是尋找只需幾行程式碼的簡單QR碼生成器,還是想要一個可以控制QR碼所有方面的更複雜生成器,例如修正級別、大小和版本,IronBarcode在一個程式庫中提供您所需的一切。

在匯入QRCodeWriter.CreateQrCode來建立一個具有URL字串值的新的QR碼。 此方法是使用預設設置建立QR碼的最簡單方法。

我們可以調整QR碼的errorCorrectionLevel以進行更多的自定義。 此級別關聯至QR碼中包含的冗餘或錯誤恢復資料的量,使其更加容錯,並確保它能在惡劣環境下正常運作。

要控制size,只需為其賦予一個整數值。 qrVersion(介於1到40之間)代表QR碼的版本。 根據您希望儲存的資料量以及QR碼的容量需求,開發者可以精細調整以平衡容量和大小,確保最佳化。 有關如何確定QR碼版本的更多資訊,請參閱此文件

最後,我們將所有設定的變數size, qrVersion, 和QRCodeWriter.CreateQrCode方法,以生成包含上述所有屬性的自定義QR碼。

探索如何建立自定義條碼圖片
在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天試用金鑰
無需信用卡或帳戶建立