IronBarcode ハウツー Code 39バーコードを読み取る How to Read Code 39 Barcodes in C# Curtis Chau 更新日:11月 19, 2025 Download IronBarcode NuGet Download テキストの検索と置換 Start Free Trial Copy for LLMs Copy for LLMs Copy page as Markdown for LLMs Open in ChatGPT Ask ChatGPT about this page Open in Gemini Ask Gemini about this page Open in Grok Ask Grok about this page Open in Perplexity Ask Perplexity about this page Share Share on Facebook Share on X (Twitter) Share on LinkedIn Copy URL Email article This article was translated from English: Does it need improvement? Translated View the article in English When it comes to inventory, logistics, and industrial applications, you need a reliable and widely compatible barcode. One of the most popular and versatile options is Code 39. A Code 39 barcode is a popular barcode format that can vary in length. The original Standard Code 39 is capable of encoding uppercase letters (A-Z), digits (0-9), and a handful of special characters (like space, -, $, +, %, and .). This was great for basic IDs, but modern needs often require encoding all 128 ASCII characters. For this, the Code 39 Extended specification was created. In this how-to, we'll show you how to easily read both the standard and extended variations of Code 39 with IronBarcode. Get started with IronBarcode 今日あなたのプロジェクトでIronBarcodeを無料トライアルで使用開始。 最初のステップ: 無料で始める How to Read Code 39 Barcodes in C# Download the IronBarcode C# library to read Code39 barcodes Initialize a new BarcodeReaderOptions Specify BarcodeEncoding.Code39 in the options Read the Code 39 barcode with Read Verify the results and print them out to the console Reading Standard Code 39 Barcode Reading a Code 39 barcode is straightforward with IronBarcode. We first initialize a new BarcodeReaderOptions and specify the barcode type, which is BarcodeEncoding.Code39. This step optimizes the reader by telling it exactly what kind of barcode to look for. Afterwards, we read the barcodes using the Read method, passing the barcode image and the options variable as parameters. We then iterate over the results collection and print the string value of each barcode to the console. Input Barcode Image This image contains a standard Code 39 barcode. Code :path=/static-assets/barcode/content-code-examples/how-to/read-code39-barcode.cs using IronBarCode; using System; BarcodeReaderOptions options = new BarcodeReaderOptions() { // Tell the reader to only look for Code 39. ExpectBarcodeTypes = BarcodeEncoding.Code39 }; // Read barcode(s) from the image file using the specified options var results = BarcodeReader.Read("code39.png", options); // Loop through each BarcodeResult found in the image foreach (var result in results) { // Print the decoded string value of the standard Code 39 barcode Console.WriteLine(result.ToString()); } IRON VB CONVERTER ERROR developers@ironsoftware.com $vbLabelText $csharpLabel Output Reading Extended Code 39 Barcode Reading an extended Code 39 barcode is quite similar to its standard counterpart. The main difference is that we must set the UseCode39ExtendedMode property to true. This setting instructs IronBarcode to interpret the special character pairs (e.g., +T, %O) and decode them into their proper full-ASCII equivalents (e.g., t, !). Input Barcode Image This image contains an extended Code 39 barcode. The value Test-Data! contains lowercase characters and an exclamation mark, which are only available in the full ASCII set and require extended mode. Code :path=/static-assets/barcode/content-code-examples/how-to/read-extended-code39-barcode.cs using IronBarCode; using System; BarcodeReaderOptions options = new BarcodeReaderOptions() { // Enable extended Code 39 mode UseCode39ExtendedMode = true, // Specify that we are expecting Code 39 barcodes ExpectBarcodeTypes = BarcodeEncoding.Code39 }; // Read barcode(s) from the extended code 39 image var results = BarcodeReader.Read("code39extended.png", options); // Loop through each BarcodeResult found in the image foreach (var result in results) { // Print the fully decoded ASCII string (e.g., "Test-Data!") Console.WriteLine(result.ToString()); } IRON VB CONVERTER ERROR developers@ironsoftware.com $vbLabelText $csharpLabel Output ヒント The console output may not properly display all ASCII characters. In those scenarios, please pipe the output to a .txt file to verify the extracted result. よくある質問 Code 39 バーコードとは何ですか? Code 39は、在庫管理、物流、産業用途で広く使用されているバーコード形式です。大文字、数字、および一部の特殊文字をエンコードできます。128文字すべてのASCII文字をサポートする拡張バージョンもあります。 C# で Code 39 バーコードを読み取るにはどうすればいいですか? IronBarcodeライブラリを使用すると、C#でCode 39バーコードを読み取ることができます。BarcodeReaderOptionsを初期化し、BarcodeEncoding.Code39を指定して、Readメソッドでバーコードデータを抽出します。 IronBarcode を使用して Code 39 バーコードを読み取るには何が必要ですか? まず、NuGetからIronBarcode C#ライブラリをダウンロードしてください。次に、BarcodeReaderOptionsオブジェクトを初期化し、バーコードの種類としてCode39を指定します。 標準コード 39 と拡張コード 39 の違いは何ですか? 標準コード 39 は、大文字、数字、およびいくつかの特殊文字をエンコードできますが、拡張コード 39 は、特殊文字のペアを使用して 128 個の ASCII 文字の完全なセットをサポートします。 IronBarcode で拡張 Code 39 バーコードを読み取るにはどうすればいいですか? 拡張Code 39バーコードを読み取るには、IronBarcodeのUseCode39ExtendedModeプロパティをtrueに設定します。これにより、ライブラリは完全なASCII文字セットをデコードできるようになります。 IronBarcode における BarcodeReaderOptions の役割は何ですか? IronBarcode の BarcodeReaderOptions を使用すると、読み取るバーコードの種類を指定し、指定された形式に焦点を当てて読み取りプロセスを最適化できます。 IronBarcode は標準および拡張 Code 39 バーコードの両方を読み取ることができますか? はい、IronBarcodeは標準Code 39バーコードと拡張Code 39バーコードの両方を読み取ることができます。拡張バーコードの場合は、UseCode39ExtendedModeプロパティがtrueに設定されていることを確認してください。 IronBarcode は Code 39 バーコードの特殊文字をサポートしていますか? はい、IronBarcodeはCode 39バーコードの特殊文字をサポートしています。標準バージョンでは一部の特殊文字がサポートされていますが、拡張バージョンではすべてのASCII文字がサポートされています。 Code 39 バーコードの完全な ASCII セットをデコードするには何が必要ですか? Code 39 バーコードの完全な ASCII セットをデコードするには、拡張バージョンを使用し、IronBarcode で UseCode39ExtendedMode プロパティを true に設定する必要があります。 IronBarcode はバーコード読み取り用の画像ファイルで動作できますか? はい、IronBarcodeは画像ファイルからバーコードを読み取ることができます。バーコード画像とBarcodeReaderOptionsをReadメソッドに渡すことで、データを抽出できます。 Curtis Chau 今すぐエンジニアリングチームとチャット テクニカルライター Curtis Chauは、カールトン大学でコンピュータサイエンスの学士号を取得し、Node.js、TypeScript、JavaScript、およびReactに精通したフロントエンド開発を専門としています。直感的で美しいユーザーインターフェースを作成することに情熱を持ち、Curtisは現代のフレームワークを用いた開発や、構造の良い視覚的に魅力的なマニュアルの作成を楽しんでいます。開発以外にも、CurtisはIoT(Internet of Things)への強い関心を持ち、ハードウェアとソフトウェアの統合方法を模索しています。余暇には、ゲームをしたりDiscordボットを作成したりして、技術に対する愛情と創造性を組み合わせています。 準備はいいですか? Nuget ダウンロード 1,935,276 | バージョン: 2025.11 ただ今リリースされました 試用ライセンスキーがメールで送信されました。 総ダウンロード数: 1,935,276 ライセンスを見る