IRONSOFTWAREHOME
與其他組件的比較

MESCIUSComponentOne C1BarCodevs IronBarcode

Curtis Chau
Curtis Chau
Updated: 2026年4月26日

MESCIUS ComponentOne的條碼控制(前身為GrapeCity,於2023年更名)在Windows Forms、WPF、WinUI、Blazor和ASP.NET Core MVC應用程式中生成條碼。 它能很好地完成這一工作——API清晰,輸出質量穩定,並能自然地與WinForms設計器整合。 但其功能範圍有限。 它無法讀取條碼。 WinForms和WPF版本只在Windows特定的目標框架上運行。 而且它不是一個單獨的產品——它作為ComponentOne Studio Enterprise的一部分供應,這是一項$1,299/每位開發者/每年訂閱,包括超過100個UI控制。 如果您正在評估.NET項目的條碼選項並在比較列表上找到了ComponentOne,本文將介紹該範圍在實際中的含意。

理解C1BarCode

C1BarCode是一個可視控制。 生成工作流程建立實例,設置屬性,並調用System.Drawing.Image

// ComponentOne C1BarCode
using C1.Win.Barcode;
using C1.BarCode;
using System.Drawing;

// License must be set before first use
C1.C1License.Key = "YOUR-COMPONENTONE-KEY";

var barcode = new C1BarCode();
barcode.CodeType = CodeType.Code128;
barcode.Text = "ITEM-12345";
barcode.BarHeight = 100;
barcode.ModuleSize = 2;
barcode.ShowText = true;
barcode.CaptionPosition = CaptionPosition.Below;

using var image = barcode.GetImage();
image.Save("barcode.png", System.Drawing.Imaging.ImageFormat.Png);

屬性設置API對於WinForms開發者來說很熟悉——它直接映射到設計器介面。 CaptionPosition都是在程式碼中以相同方式運行的設計器可見屬性。

C1BarCode支持38種符號涵蓋主流1D和2D格式:Code 39, Code 128, EAN-8, EAN-13, UPC-A, UPC-E, ITF, QR Code, PDF417 和 DataMatrix等。 對於條碼生成,它涵蓋了常見的使用情況。

無讀取API

這不是配置選項可以彌補的差距。 沒有C1BarCodeReader類。 Decode()方法。 ComponentOne的條碼控制按設計來說僅限於生成。

如果您的應用程式需要從上傳的圖像中掃描條碼,驗證列印標籤,處理具有嵌入程式碼的文件,或從網路API中提取QR程式碼資料——C1BarCode無法做到這一點。 您將需要一個單獨的庫來讀取,這會引發為什麼要在一個覆蓋100多個控制的企業套件中支付僅限於條碼生成的組件的費用,而獨立的條碼庫涵蓋了這兩個操作。

缺少讀取API對於設計為列印輸出的WinForms條碼控制來說並不罕見。 當需求擴大時這就成了需要考慮的問題——而條碼需求幾乎總是會擴大。

僅限於Windows

C1BarCode的WinForms和WPF版本需要Windows特定的目標框架配置:

<!-- ComponentOne WinForms edition target -->
<TargetFramework>net8.0-windows</TargetFramework>
<UseWindowsForms>true</UseWindowsForms>
XML

UseWindowsForms不是可選的。 Graphics——而這些僅存在於Windows上。 移除net8.0-windows會導致構建失敗。 ComponentOne確實提供針對跨平台TFM的Blazor和ASP.NET Core MVC版本的條碼控制,但WinForms和WPF套件受限於Windows。

相比之下,IronBarcode的目標是net8.0(或任何支持的TFM)而沒有平台限制:

<!--IronBarcode— standard cross-platform target -->
<TargetFramework>net8.0</TargetFramework>
<!-- 否 UseWindowsForms required -->
<!-- Runs on Linux, macOS, Docker, Azure Functions -->
XML

在幾種實際情況下這很重要:

  • Linux上的Azure App Service: 新的App Service部署的預設計畫。 net8.0-windows 無法定位到它。
  • Docker容器: Linux容器是標準。 Windows容器更大,成本更高,並在許多雲層中不可用。
  • ASP.NET Core Web API: 僅能部署到Windows的條碼生成端點是團隊最終需要移除的部署限制。
  • Azure Functions: 使用量方案在Linux上運行。 具有net8.0-windows目標的條碼生成函式無法部署到使用量方案。
  • macOS開發: 使用macOS的開發者無法本地運行net8.0-windows項目,即使用於測試生成邏輯。

如果您的應用程式是只能在Windows上運行的WinForms桌面工具,那麼平台限制不是問題。 一旦部署需求包括任何Linux或雲環境,這就成了問題。

套件綑綁

C1BarCode控制作為ComponentOne Studio Enterprise的一部分出售,該套件包括WinForms、WPF、Blazor和ASP.NET的完整ComponentOne控制套件。 ComponentOne Studio Enterprise的定價為每位開發者每年$1,299(訂閱); 單一平台版本(WinForms或WPF)為每位開發者每年$799。

該套件包括超過100個組件:網格、圖表、計劃、輸入控制、報告設計工具、地圖控制、儀表等等。 如果您正在構建一個以資料為主的應用程式並需要這些控制中的很多個,那麼套件定價可能有意義。 如果您需要條碼生成並選擇ComponentOne是因為它出現在搜索中,那麼您主要是為了一個控制購買企業UI套件。

NuGet包是C1.Blazor.BarCode),並通過ComponentOne Studio訂閱來授權。 對於希望獲得條碼功能而不需整個套件的開發者,沒有單獨的條碼專用授權級別。

IronBarcode的定價結構不同:它是一個獨立的條碼庫,以永久授權開始,單位開發者$999(Lite),三位$1,499(Plus),十位$2,399(Professional),無限開發者$4,799(Unlimited)。 沒有網格控制,沒有圖表庫,沒有報告設計器——只有您尋找的條碼功能。

QR程式碼自訂

兩個庫都支持具有自訂選項的QR程式碼生成。 API風格不同相當大。

ComponentOne屬性設置方法:

// ComponentOne — QR code with error correction and color
using C1.Win.Barcode;
using C1.BarCode;
using System.Drawing;

C1.C1License.Key = "YOUR-COMPONENTONE-KEY";

var barcode = new C1BarCode();
barcode.CodeType = CodeType.QRCode;
barcode.Text = "https://example.com/product/4821";
barcode.QRCodeVersion = QRCodeVersion.Version5;
barcode.QRCodeErrorCorrectionLevel = QRCodeErrorCorrectionLevel.High;
barcode.QRCodeModel = QRCodeModel.Model2;
barcode.ForeColor = Color.DarkBlue;
barcode.BackColor = Color.White;
barcode.ModuleSize = 4;

using var image = barcode.GetImage();
image.Save("product-qr.png", System.Drawing.Imaging.ImageFormat.Png);

IronBarcode流暢鏈:

//IronBarcode— QR code with error correction and color
// NuGet: dotnet add package IronBarcode
using IronBarCode;
using System.Drawing;

QRCodeWriter.CreateQrCode(
        "https://example.com/product/4821",
        300,
        QRCodeWriter.QrErrorCorrectionLevel.Highest)
    .ChangeBarCodeColor(Color.DarkBlue)
    .SaveAsPng("product-qr.png");

ComponentOne的方法需要實例化一個GetImage()。 IronBarcode的.SaveAsPng()。 沒有要管理的實例。

IronBarcode還支持在QR程式碼中嵌入徽標,而C1BarCode則不支持:

// QR code with embedded brand logo
QRCodeWriter.CreateQrCode("https://example.com/track/8821", 500)
    .AddBrandLogo("company-logo.png")
    .ChangeBarCodeColor(Color.DarkBlue)
    .SaveAsPng("branded-qr.png");

理解IronBarcode

IronBarcode是一個獨立的.NET條碼庫,涵蓋生成和讀取。 它可從NuGet中安裝 (dotnet add package IronBarcode),支持任何.NET TFM而無平台限制,並在Windows、Linux、macOS、Docker、Azure和AWS Lambda上運行。

讀取部分原生支持PDF文件:

// Read barcodes from a PDF — no image extraction needed
using IronBarCode;

var results = BarcodeReader.Read("invoice.pdf");
foreach (var barcode in results)
{
    Console.WriteLine($"Page {barcode.PageNumber}: {barcode.Format}{barcode.Value}");
}

對於高吞吐量場景,BarcodeReaderOptions控制速度與準確性的權衡及多條碼檢測:

// Multi-barcode read with performance options
using IronBarCode;

var options = new BarcodeReaderOptions
{
    Speed = ReadingSpeed.Balanced,
    ExpectMultipleBarcodes = true,
    ExpectBarcodeTypes = BarcodeEncoding.Code128 | BarcodeEncoding.QRCode
};

var results = BarcodeReader.Read("warehouse-manifest.jpg", options);

生成涵蓋標準格式,具有一致的靜態API:

// Code 128 generation to file
BarcodeWriter.CreateBarcode("SHIP-20240312-7834", BarcodeEncoding.Code128)
    .SaveAsPng("shipping-label.png");

//QR碼生成to byte array (for HTTP response)
byte[] qrBytes = QRCodeWriter.CreateQrCode("https://example.com/order/7734", 400)
    .ToPngBinaryData();
C#

支持的平台:Windows、Linux、macOS、Docker、Azure(App Service和Functions)、AWS Lambda。 支持的.NET版本:.NET Framework 4.6.2+,.NET Core 3.1+,以及.NET 5/6/7/8。

特性比較

特性MESCIUSComponentOne C1BarCodeIronBarcode
條碼生成
條碼讀取
QR碼生成
QR 標誌嵌入
PDF讀取輸入不適用(無讀取)是的(原生)
.NET平台目標(WinForms/WPF版)net8.0-windows任何TFM(net8.0等)
需要UseWindowsForms(WinForms版)
Linux / Docker部署僅限Blazor/ASP.NET MVC版
macOS部署僅限Blazor/ASP.NET MVC版
Azure Functions(Linux)僅限Blazor/ASP.NET MVC版
ASP.NET Core伺服器端ASP.NET Core MVC版
獨立NuGet包套件授權包
獨立定價不適用從$999永久(Lite)
套件定價$1,299/開發者/年Enterprise;$799/開發者/年單一平台不適用
流暢生成API否(屬性設置)
BarcodeReader.Read()
BarcodeWriter.CreateBarcode()
QRCodeWriter.CreateQrCode()
支持的.NET版本.NET 6+(WinForms/WPF的Windows).NET Framework 4.6.2+, .NET Core 3.1+, .NET 5–8
永久授權選項否(訂閱)

API對映參考

對於從C1BarCode遷移到IronBarcode的團隊,這些直接等效適用:

ComponentOne C1BarCodeIronBarcode
C1.C1License.Key = "..."IronBarCode.License.LicenseKey = "YOUR-LICENSE-KEY"
new C1BarCode()靜態——無需實例
barcode.CodeType = CodeType.Code128BarcodeEncoding.Code128(作為參數傳遞)
barcode.Text = "data"BarcodeWriter.CreateBarcode()的第一個參數
barcode.BarHeight = 100.ResizeTo(width, 100)在條碼編寫器上
barcode.ModuleSize = 2.ResizeTo()控制以像素為單位的大小
barcode.ForeColor = Color.DarkBlue.ChangeBarCodeColor(Color.DarkBlue)
barcode.BackColor = Color.White.ChangeBackgroundColor(Color.White)
barcode.GetImage().SaveAsPng() / .ToPngBinaryData()
barcode.QRCodeErrorCorrectionLevelQRCodeWriter.QrErrorCorrectionLevel枚舉
barcode.QRCodeVersion自動(或版本參數)
無讀取APIBarcodeReader.Read(path)
net8.0-windows需要net8.0(或任何TFM)
UseWindowsForms = true需要不需要

當團隊轉換

讀取需求出現。 這是最常見的觸發器。 一個團隊用C1BarCode建構條碼標籤生成,然後有要求驗證掃描、處理入站的運輸文件或從上傳圖像解碼QR程式碼。 C1BarCode幫不上忙。選擇是:新增第二個條碼庫來讀取,或者用能處理這兩者的庫替代C1BarCode。

Linux或Docker部署。 發布到Windows桌面的WinForms桌面應用程式不面臨這種限制。 一個ASP.NET Core API生成條碼圖像確實這樣做——特別是當它需要運行在Linux容器中或部署到Linux上的Azure App Service時。 net8.0-windows目標框架立即阻擋了這些部署選項。

微服務或無伺服器架構。 Azure Functions、AWS Lambda和容器化微服務是Linux優先。無法部署到Linux的條碼生成服務不是可行的微服務。

套件訂閱成本與需求範圍。 那些為ComponentOne Studio Enterprise支付費用並且已經使用其網格、圖表和其他控件的團隊已經證明了訂閱的合理性。 主要或完全為條碼生成而訂閱的團隊正在為他們不使用的100多個控件支付費用。 每位開發者的訂閱成本隨團隊規模增加。

永久授權偏好。 ComponentOne Studio僅限於訂閱。 沒有永久授權選項。 對於那些希望擁有他們發布的軟體的團隊——特別是出於合規性或長期維護原因——IronBarcode的永久授權(從$999 Lite開始)結構上有所不同。

結論

C1BarCode在WinForms上下文中乾淨地生成條碼。 這確實是它擅長的事情,對於僅需要在Windows上進行標籤生成的WinForms桌面應用程式來說,這是ComponentOne套件內功能選擇。

範圍僅止於此。 無讀取,僅限Windows部署,無獨立包,訂閱授權。 當項目需求超出Windows上的WinForms生成時——一個讀取需求,一個Linux部署目標,一個網路API,一個Docker容器,一個雲函式——C1BarCode無法應對。 IronBarcode涵蓋生成和讀取,運行於.NET支持的任何平台,並作為獨立包提供,無需訂閱100控件的企業套件。

Curtis Chau
技術作家

Curtis Chau擁有Carleton大學的電腦科學學士學位,專精於前端開發,擁有Node.js、TypeScript、JavaScript和React的專業知識。Curtis熱衷於建立直觀且美觀的使用者介面,喜愛使用現代框架並建立結構良好、視覺吸引力的手冊。

...
閱讀更多

相關文章

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天試用金鑰
無需信用卡或帳戶建立