.NET MAUI ile Bir Masaüstü Barkod Uygulaması (Tarayıcı/Üreteci) Nasıl Oluşturulur?

This article was translated from English: Does it need improvement?
Translated
View the article in English

Kapsamlı bir yazılım çözümü için, yalnızca mobil erişilebilirlikten bahsetmek yetmez. Windows ve macOS gibi masaüstü işletim sistemlerinde yerel olarak konuşlandırma yeteneği de aynı derecede kritiktir. Bu çapraz platform yaklaşımı, işletmelerin varlık izleme ve yönetim gibi yüksek hacimli işler için iş istasyonlarının tüm gücünü kullanmasına olanak tanır.

Uygun masaüstü desteği olmadan, iş akışları kesilir ya da daha kötüsü, daha az yetenekli cihazlara aktarılır. Özellikle, ofis personelinin masalarından kalkmadan hızlı bir şekilde kod grupları oluşturabileceği veya taramalarını doğrulayabileceği envanter yönetiminde bu son derece önemlidir.

IronBarcode, bu özellikleri uygulamak için gerekli araçları sunar ve .NET MAUI uygulamanızın herhangi bir bilgisayarda güvenilir şekilde çalışmasını sağlar.

Bu makalede, hem bir Masaüstü Barkod Tarayıcı hem de bir Masaüstü Barkod Üreticisi oluşturmak için IronBarcode'un nasıl entegre edileceğini açıklayacağız.



.NET MAUI Masaüstü Uygulaması

IronBarcode'u bir .NET MAUI uygulamasına entegre etmek oldukça basittir, çünkü kütüphane masaüstü platformu ile kutudan çıkar çıkmaz uyumlu çalışır. Bu örnekte, IronBarcode kullanarak ayrı olarak bir barkod tarayıcı ve bir barkod üretici oluşturacağız.

Öncelikle barkod tarayıcı ile başlayalım.

Barkod Tarayıcı Arayüzü XAML

.NET MAUI arayüzü için basit bir arayüz uygulanır ve kullanıcılara bir gönder düğmesi aracılığıyla barkod görüntüleri yüklemelerine izin verilir. Projede yer alan MainPage.xaml dosyası, aşağıda gösterilen içerikle değiştirilmelidir.

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="MauiApp1.MainPage"
             BackgroundColor="{DynamicResource PageBackgroundColor}">

    <ScrollView>
        <VerticalStackLayout Spacing="25" Padding="30" VerticalOptions="Center">

            <Label Text="Desktop Barcode Scanner"
                   FontSize="32"
                   HorizontalOptions="Center" />

            <Image x:Name="ScannerImage"
                   HeightRequest="300"
                   WidthRequest="400"
                   BackgroundColor="#F0F0F0"
                   Aspect="AspectFit"
                   HorizontalOptions="Center" />

            <Button Text="Select Image to Scan"
                    Clicked="OnScanButtonClicked"
                    HorizontalOptions="Center" 
                    WidthRequest="200"/>

            <Label x:Name="ResultLabel"
                   Text="Result will appear here..."
                   FontSize="20"
                   HorizontalOptions="Center"
                   HorizontalTextAlignment="Center" />

        </VerticalStackLayout>
    </ScrollView>

</ContentPage>
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="MauiApp1.MainPage"
             BackgroundColor="{DynamicResource PageBackgroundColor}">

    <ScrollView>
        <VerticalStackLayout Spacing="25" Padding="30" VerticalOptions="Center">

            <Label Text="Desktop Barcode Scanner"
                   FontSize="32"
                   HorizontalOptions="Center" />

            <Image x:Name="ScannerImage"
                   HeightRequest="300"
                   WidthRequest="400"
                   BackgroundColor="#F0F0F0"
                   Aspect="AspectFit"
                   HorizontalOptions="Center" />

            <Button Text="Select Image to Scan"
                    Clicked="OnScanButtonClicked"
                    HorizontalOptions="Center" 
                    WidthRequest="200"/>

            <Label x:Name="ResultLabel"
                   Text="Result will appear here..."
                   FontSize="20"
                   HorizontalOptions="Center"
                   HorizontalTextAlignment="Center" />

        </VerticalStackLayout>
    </ScrollView>

</ContentPage>
XML

Masaüstü Barkod Tarayıcı Mantığı CS

Ardından, kullanıcının düğmeye tıkladığında oluşacak mantık uygulanır. UI'daki tarama düğmesine OnScanButtonClicked olay işleyicisi eklenmiştir.

PickPhotoAsync, kullanıcıların yüklemek istedikleri barkodu seçmesine izin vermek için ilk olarak kullanılır, ardından dosya akışına erişmek için OpenReadAsync kullanılır. Görüntü verileri, CopyToAsync kullanılarak hemen bir MemoryStream 'ye kopyalanır. Bu, verilerin aynı anda hem ekranda görüntülenmesi hem de barkodu taramak için Read yönteminin kullanılmasını sağlar.

Son olarak, geçerli bir barkod algılandığında barkod değeri kullanıcı arayüzünde görüntülenir ya da görüntüde barkod bulunmadığını belirten kırmızı bir mesaj gösterilir.

Lütfen dikkate alin Lisans anahtarınızı testten önce kendi anahtarınızla değiştirin.

using IronBarCode;

namespace MauiApp1
{
    public partial class MainPage : ContentPage
    {
        public MainPage()
        {
            InitializeComponent();
            // Your license key is set here
            IronBarCode.License.LicenseKey = "YOUR_KEY"
        }

        private async void OnScanButtonClicked(object sender, EventArgs e)
        {
            try
            {
                var fileResult = await MediaPicker.Default.PickPhotoAsync();

                if (fileResult != null)
                {
                    // 1. Copy the file content into a byte array or MemoryStream immediately
                    // This ensures we have the data in memory before the file closes
                    byte[] imageBytes;
                    using (var stream = await fileResult.OpenReadAsync())
                    using (var memoryStream = new MemoryStream())
                    {
                        await stream.CopyToAsync(memoryStream);
                        imageBytes = memoryStream.ToArray();
                    }

                    // 2. Set the Image Source for the UI
                    // We give the UI a FRESH stream from the bytes we just saved
                    ScannerImage.Source = ImageSource.FromStream(() => new MemoryStream(imageBytes));

                    // 3. Process the Barcode
                    // We give IronBarcode its OWN fresh stream from the same bytes
                    using (var processingStream = new MemoryStream(imageBytes))
                    {
                        // 4. Read the barcode with Read
                        var results = BarcodeReader.Read(processingStream);

                        // 5. Display barcode results
                        if (results != null && results.Count > 0)
                        {

                            // Successfully found barcode value
                            ResultLabel.Text = $"Success: {results[0].Value}";
                            ResultLabel.TextColor = Colors.Green;
                        }
                        else
                        {
                            // Image uploaded has no barcode or barcode value is not found
                            ResultLabel.Text = "No barcode detected.";
                            ResultLabel.TextColor = Colors.Red;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                // Display any exception thrown in runtime
                ResultLabel.Text = $"Error: {ex.Message}";
                ResultLabel.TextColor = Colors.Red;
            }
        }
    }
}
using IronBarCode;

namespace MauiApp1
{
    public partial class MainPage : ContentPage
    {
        public MainPage()
        {
            InitializeComponent();
            // Your license key is set here
            IronBarCode.License.LicenseKey = "YOUR_KEY"
        }

        private async void OnScanButtonClicked(object sender, EventArgs e)
        {
            try
            {
                var fileResult = await MediaPicker.Default.PickPhotoAsync();

                if (fileResult != null)
                {
                    // 1. Copy the file content into a byte array or MemoryStream immediately
                    // This ensures we have the data in memory before the file closes
                    byte[] imageBytes;
                    using (var stream = await fileResult.OpenReadAsync())
                    using (var memoryStream = new MemoryStream())
                    {
                        await stream.CopyToAsync(memoryStream);
                        imageBytes = memoryStream.ToArray();
                    }

                    // 2. Set the Image Source for the UI
                    // We give the UI a FRESH stream from the bytes we just saved
                    ScannerImage.Source = ImageSource.FromStream(() => new MemoryStream(imageBytes));

                    // 3. Process the Barcode
                    // We give IronBarcode its OWN fresh stream from the same bytes
                    using (var processingStream = new MemoryStream(imageBytes))
                    {
                        // 4. Read the barcode with Read
                        var results = BarcodeReader.Read(processingStream);

                        // 5. Display barcode results
                        if (results != null && results.Count > 0)
                        {

                            // Successfully found barcode value
                            ResultLabel.Text = $"Success: {results[0].Value}";
                            ResultLabel.TextColor = Colors.Green;
                        }
                        else
                        {
                            // Image uploaded has no barcode or barcode value is not found
                            ResultLabel.Text = "No barcode detected.";
                            ResultLabel.TextColor = Colors.Red;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                // Display any exception thrown in runtime
                ResultLabel.Text = $"Error: {ex.Message}";
                ResultLabel.TextColor = Colors.Red;
            }
        }
    }
}
Imports IronBarCode

Namespace MauiApp1
    Partial Public Class MainPage
        Inherits ContentPage

        Public Sub New()
            InitializeComponent()
            ' Your license key is set here
            IronBarCode.License.LicenseKey = "YOUR_KEY"
        End Sub

        Private Async Sub OnScanButtonClicked(ByVal sender As Object, ByVal e As EventArgs)
            Try
                Dim fileResult = Await MediaPicker.Default.PickPhotoAsync()

                If fileResult IsNot Nothing Then
                    ' 1. Copy the file content into a byte array or MemoryStream immediately
                    ' This ensures we have the data in memory before the file closes
                    Dim imageBytes As Byte()
                    Using stream = Await fileResult.OpenReadAsync(), memoryStream = New MemoryStream()
                        Await stream.CopyToAsync(memoryStream)
                        imageBytes = memoryStream.ToArray()
                    End Using

                    ' 2. Set the Image Source for the UI
                    ' We give the UI a FRESH stream from the bytes we just saved
                    ScannerImage.Source = ImageSource.FromStream(Function() New MemoryStream(imageBytes))

                    ' 3. Process the Barcode
                    ' We give IronBarcode its OWN fresh stream from the same bytes
                    Using processingStream = New MemoryStream(imageBytes)
                        ' 4. Read the barcode with Read
                        Dim results = BarcodeReader.Read(processingStream)

                        ' 5. Display barcode results
                        If results IsNot Nothing AndAlso results.Count > 0 Then
                            ' Successfully found barcode value
                            ResultLabel.Text = $"Success: {results(0).Value}"
                            ResultLabel.TextColor = Colors.Green
                        Else
                            ' Image uploaded has no barcode or barcode value is not found
                            ResultLabel.Text = "No barcode detected."
                            ResultLabel.TextColor = Colors.Red
                        End If
                    End Using
                End If
            Catch ex As Exception
                ' Display any exception thrown in runtime
                ResultLabel.Text = $"Error: {ex.Message}"
                ResultLabel.TextColor = Colors.Red
            End Try
        End Sub
    End Class
End Namespace
$vbLabelText   $csharpLabel

Barkod Değeri Bulunan Çıktı

Bulunan Barkodlar çıktısı

Gördüğünüz gibi, uygulama barkod sonucunu ve yüklenen barkod görüntüsünü sergiliyor.

Barkod Değeri Bulunamayan Çıktı

Bulunamayan Barkodlar çıktısı

Gördüğünüz gibi, kullanıcı bir barkod içermeyen bir görüntü yüklediğinde, 'Barkod Bulunamadı' yazan kırmızı bir mesaj gösterilir.

Masaüstü Barkod Üretici

Bir sonraki bölüm, IronBarcode'u MAUI'ye entegre ederek bir barkod üretici oluşturma fikrini geliştirir.

Barkod Üretici Arayüzü XAML

Üreticinin arayüzü için, metin girişi ve açılır menü aracılığıyla barkod türü seçilmesine izin veren basit bir form uygulanır. Sonucu görüntülemek için bir resim görünümü ile birlikte üretim ve kaydetme sürecini başlatmak için bir düğme bulunmaktadır. MainPage.xaml dosyası aşağıda gösterilen içerik ile değiştirilmelidir.

Tam 1D barkod listesi için buradan ve 2D barkodlar için buradan göz atın.

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="MauiApp1.MainPage"
             BackgroundColor="{DynamicResource PageBackgroundColor}">

    <ScrollView>
        <VerticalStackLayout Spacing="20" Padding="30" VerticalOptions="Center">

            <Label Text="Barcode Generator"
                   FontSize="32"
                   HorizontalOptions="Center" />

            <Entry x:Name="BarcodeEntry"
                   Placeholder="Enter value (e.g. 12345 or https://ironsoftware.com)"
                   WidthRequest="300" />

            <Picker x:Name="BarcodeTypePicker"
                    Title="Select Barcode Type"
                    WidthRequest="300">
                <Picker.ItemsSource>
                    <x:Array Type="{x:Type x:String}">
                        <x:String>QRCode</x:String>
                        <x:String>Code128</x:String>
                        <x:String>EAN13</x:String>
                        <x:String>Code39</x:String>
                        <x:String>PDF417</x:String>
                    </x:Array>
                </Picker.ItemsSource>
            </Picker>

            <Button Text="Generate &amp; Save"
                    Clicked="OnGenerateButtonClicked"
                    HorizontalOptions="Center"
                    WidthRequest="200" />

            <Image x:Name="GeneratedImage"
                   HeightRequest="200"
                   WidthRequest="300"
                   BackgroundColor="#F0F0F0"
                   Aspect="AspectFit" />

            <Label x:Name="StatusLabel"
                   FontSize="16"
                   HorizontalOptions="Center"
                   HorizontalTextAlignment="Center" />

        </VerticalStackLayout>
    </ScrollView>

</ContentPage>
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="MauiApp1.MainPage"
             BackgroundColor="{DynamicResource PageBackgroundColor}">

    <ScrollView>
        <VerticalStackLayout Spacing="20" Padding="30" VerticalOptions="Center">

            <Label Text="Barcode Generator"
                   FontSize="32"
                   HorizontalOptions="Center" />

            <Entry x:Name="BarcodeEntry"
                   Placeholder="Enter value (e.g. 12345 or https://ironsoftware.com)"
                   WidthRequest="300" />

            <Picker x:Name="BarcodeTypePicker"
                    Title="Select Barcode Type"
                    WidthRequest="300">
                <Picker.ItemsSource>
                    <x:Array Type="{x:Type x:String}">
                        <x:String>QRCode</x:String>
                        <x:String>Code128</x:String>
                        <x:String>EAN13</x:String>
                        <x:String>Code39</x:String>
                        <x:String>PDF417</x:String>
                    </x:Array>
                </Picker.ItemsSource>
            </Picker>

            <Button Text="Generate &amp; Save"
                    Clicked="OnGenerateButtonClicked"
                    HorizontalOptions="Center"
                    WidthRequest="200" />

            <Image x:Name="GeneratedImage"
                   HeightRequest="200"
                   WidthRequest="300"
                   BackgroundColor="#F0F0F0"
                   Aspect="AspectFit" />

            <Label x:Name="StatusLabel"
                   FontSize="16"
                   HorizontalOptions="Center"
                   HorizontalTextAlignment="Center" />

        </VerticalStackLayout>
    </ScrollView>

</ContentPage>
XML

Masaüstü Barkod Üretici Mantığı CS

Ardından, düğme tıklama olayı için mantık uygulanır. UI'daki oluştur düğmesine OnGenerateButtonClicked olay işleyicisi eklenmiştir.

Metnin mevcut olduğunu ve bir türün seçildiğini doğrulamak için kullanıcı girişi doğrulanır, ardından seçim doğru BarcodeEncoding ile eşleştirilir. BarcodeWriter.CreateBarcode, görüntüyü oluşturmak, boyutlandırmak ve JPEG ikili verisine dönüştürmek için kullanılır. Görüntü daha sonra bir MemoryStream kullanılarak ekranda görüntülenir.

Son olarak, oluşturulan barkod dosyası doğrudan kullanıcının Masaüstüne File.WriteAllBytes kullanılarak kaydedilir ve durum etiketi, kaydedilen yeri doğrulamak için güncellenir.

Lütfen dikkate alin Lisans anahtarınızı testten önce kendi anahtarınızla değiştirin.

using IronBarCode;
using System.IO; // Required for saving files

namespace MauiApp1
{
    public partial class MainPage : ContentPage
    {
        public MainPage()
        {
            InitializeComponent();
            IronBarCode.License.LicenseKey = "YOUR-KEY";

            // Set default selection
            BarcodeTypePicker.SelectedIndex = 0;
        }

        private void OnGenerateButtonClicked(object sender, EventArgs e)
        {
            try
            {
                // 1. Get and Validate Input
                string text = BarcodeEntry.Text;

                if (string.IsNullOrWhiteSpace(text))
                {
                    StatusLabel.Text = "Error: Please enter text.";
                    StatusLabel.TextColor = Colors.Red;
                    return;
                }

                if (BarcodeTypePicker.SelectedIndex == -1)
                {
                    StatusLabel.Text = "Error: Please select a type.";
                    StatusLabel.TextColor = Colors.Red;
                    return;
                }

                // 2. Determine Encoding Type
                string selectedType = BarcodeTypePicker.SelectedItem.ToString();
                BarcodeEncoding encoding = BarcodeEncoding.QRCode;

                switch (selectedType)
                {
                    case "QRCode": encoding = BarcodeEncoding.QRCode; break;
                    case "Code128": encoding = BarcodeEncoding.Code128; break;
                    case "EAN13": encoding = BarcodeEncoding.EAN13; break;
                    case "Code39": encoding = BarcodeEncoding.Code39; break;
                    case "PDF417": encoding = BarcodeEncoding.PDF417; break;
                }

                // 3. Generate Barcode
                var barcode = BarcodeWriter.CreateBarcode(text, encoding);
                barcode.ResizeTo(400, 200); // Optional resizing

                // 4. Convert to Bytes (JPEG)
                var bytes = barcode.ToJpegBinaryData();

                // 5. Update UI
                GeneratedImage.Source = ImageSource.FromStream(() => new MemoryStream(bytes));

                // 6. Save to Desktop automatically
                string desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
                string fileName = $"barcode_{DateTime.Now:yyyyMMdd_HHmmss}.jpg";
                string fullPath = Path.Combine(desktopPath, fileName);

                File.WriteAllBytes(fullPath, bytes);

                // 7. Show Success Message
                StatusLabel.Text = $"Saved to Desktop:\n{fileName}";
                StatusLabel.TextColor = Colors.Green;
            }
            catch (Exception ex)
            {
                StatusLabel.Text = $"Error: {ex.Message}";
                StatusLabel.TextColor = Colors.Red;
            }
        }
    }
}
using IronBarCode;
using System.IO; // Required for saving files

namespace MauiApp1
{
    public partial class MainPage : ContentPage
    {
        public MainPage()
        {
            InitializeComponent();
            IronBarCode.License.LicenseKey = "YOUR-KEY";

            // Set default selection
            BarcodeTypePicker.SelectedIndex = 0;
        }

        private void OnGenerateButtonClicked(object sender, EventArgs e)
        {
            try
            {
                // 1. Get and Validate Input
                string text = BarcodeEntry.Text;

                if (string.IsNullOrWhiteSpace(text))
                {
                    StatusLabel.Text = "Error: Please enter text.";
                    StatusLabel.TextColor = Colors.Red;
                    return;
                }

                if (BarcodeTypePicker.SelectedIndex == -1)
                {
                    StatusLabel.Text = "Error: Please select a type.";
                    StatusLabel.TextColor = Colors.Red;
                    return;
                }

                // 2. Determine Encoding Type
                string selectedType = BarcodeTypePicker.SelectedItem.ToString();
                BarcodeEncoding encoding = BarcodeEncoding.QRCode;

                switch (selectedType)
                {
                    case "QRCode": encoding = BarcodeEncoding.QRCode; break;
                    case "Code128": encoding = BarcodeEncoding.Code128; break;
                    case "EAN13": encoding = BarcodeEncoding.EAN13; break;
                    case "Code39": encoding = BarcodeEncoding.Code39; break;
                    case "PDF417": encoding = BarcodeEncoding.PDF417; break;
                }

                // 3. Generate Barcode
                var barcode = BarcodeWriter.CreateBarcode(text, encoding);
                barcode.ResizeTo(400, 200); // Optional resizing

                // 4. Convert to Bytes (JPEG)
                var bytes = barcode.ToJpegBinaryData();

                // 5. Update UI
                GeneratedImage.Source = ImageSource.FromStream(() => new MemoryStream(bytes));

                // 6. Save to Desktop automatically
                string desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
                string fileName = $"barcode_{DateTime.Now:yyyyMMdd_HHmmss}.jpg";
                string fullPath = Path.Combine(desktopPath, fileName);

                File.WriteAllBytes(fullPath, bytes);

                // 7. Show Success Message
                StatusLabel.Text = $"Saved to Desktop:\n{fileName}";
                StatusLabel.TextColor = Colors.Green;
            }
            catch (Exception ex)
            {
                StatusLabel.Text = $"Error: {ex.Message}";
                StatusLabel.TextColor = Colors.Red;
            }
        }
    }
}
Imports IronBarCode
Imports System.IO ' Required for saving files

Namespace MauiApp1
    Public Partial Class MainPage
        Inherits ContentPage

        Public Sub New()
            InitializeComponent()
            IronBarCode.License.LicenseKey = "YOUR-KEY"

            ' Set default selection
            BarcodeTypePicker.SelectedIndex = 0
        End Sub

        Private Sub OnGenerateButtonClicked(sender As Object, e As EventArgs)
            Try
                ' 1. Get and Validate Input
                Dim text As String = BarcodeEntry.Text

                If String.IsNullOrWhiteSpace(text) Then
                    StatusLabel.Text = "Error: Please enter text."
                    StatusLabel.TextColor = Colors.Red
                    Return
                End If

                If BarcodeTypePicker.SelectedIndex = -1 Then
                    StatusLabel.Text = "Error: Please select a type."
                    StatusLabel.TextColor = Colors.Red
                    Return
                End If

                ' 2. Determine Encoding Type
                Dim selectedType As String = BarcodeTypePicker.SelectedItem.ToString()
                Dim encoding As BarcodeEncoding = BarcodeEncoding.QRCode

                Select Case selectedType
                    Case "QRCode"
                        encoding = BarcodeEncoding.QRCode
                    Case "Code128"
                        encoding = BarcodeEncoding.Code128
                    Case "EAN13"
                        encoding = BarcodeEncoding.EAN13
                    Case "Code39"
                        encoding = BarcodeEncoding.Code39
                    Case "PDF417"
                        encoding = BarcodeEncoding.PDF417
                End Select

                ' 3. Generate Barcode
                Dim barcode = BarcodeWriter.CreateBarcode(text, encoding)
                barcode.ResizeTo(400, 200) ' Optional resizing

                ' 4. Convert to Bytes (JPEG)
                Dim bytes = barcode.ToJpegBinaryData()

                ' 5. Update UI
                GeneratedImage.Source = ImageSource.FromStream(Function() New MemoryStream(bytes))

                ' 6. Save to Desktop automatically
                Dim desktopPath As String = Environment.GetFolderPath(Environment.SpecialFolder.Desktop)
                Dim fileName As String = $"barcode_{DateTime.Now:yyyyMMdd_HHmmss}.jpg"
                Dim fullPath As String = Path.Combine(desktopPath, fileName)

                File.WriteAllBytes(fullPath, bytes)

                ' 7. Show Success Message
                StatusLabel.Text = $"Saved to Desktop:{Environment.NewLine}{fileName}"
                StatusLabel.TextColor = Colors.Green
            Catch ex As Exception
                StatusLabel.Text = $"Error: {ex.Message}"
                StatusLabel.TextColor = Colors.Red
            End Try
        End Sub
    End Class
End Namespace
$vbLabelText   $csharpLabel

Üretilen Barkod ile Çıktı

Barkod Üretme Başarısı

Gördüğünüz gibi, uygulama üretilen barkodu gösterir ve kullanıcının masaüstüne kaydeder.

Çıkış Başarısızlığı

Barkod Üretme Başarısızlığı

Belirli barkod türlerinin giriş değeri için kısıtlamaları ve format gereksinimleri vardır. Barkod üretilemediğinde, uygulama IronBarcode istisnasını yukarıda gösterildiği gibi sergiler. Her bir barkod türünün formatı için sırasıyla 1D ve 2D ayrıntılarına başvurun.

Yukarıdaki örnekleri test etmek için (Masaüstü Barkod Tarayıcı ve Masaüstü Barkod Üretici) bu örnek projeyi indirin.

Sıkça Sorulan Sorular

.NET MAUI nedir?

.NET MAUI, C# ve XAML ile yerel mobil ve masaüstü uygulamalar oluşturan çapraz platform bir çerçevedir. Geliştiricilerin Android, iOS, macOS ve Windows için tek bir kod tabanı kullanarak uygulamalar yapmalarını sağlar.

.NET MAUI uygulamasında IronBarcode nasıl kullanılabilir?

IronBarcode, barkod üretimi ve tarama yeteneklerini etkinleştirmek için bir .NET MAUI uygulamasına entegre edilebilir. Çoklu masaüstü platformlarında barkod oluşturma ve okuma işlemlerini basit bir şekilde sağlar.

IronBarcode hangi tür barkodlar oluşturabilir?

IronBarcode, QR kodları, Kod 128, Kod 39, UPC, EAN ve daha birçok barkod formatının üretilmesini destekler, bu da herhangi bir masaüstü uygulama ihtiyaçı için çok yönlü bir araç haline getirir.

IronBarcode ile oluşturulmuş bir masaüstü uygulama kullanarak barkod taramak mümkün mü?

Evet, IronBarcode masaüstü uygulamalarda barkod taramak için kullanılabilir, bu da kullanıcıların uygulama arayüzü üzerinden barkod bilgilerini hızlı ve verimli bir şekilde kodunu çözmelerini sağlar.

Barkod uygulamaları için IronBarcode kullanmanın avantajları nelerdir?

IronBarcode yüksek doğruluk, hız ve kullanım kolaylığı sunar. .NET MAUI ile sorunsuz entegre olur ve masaüstü uygulamalarda barkod üretme ve taramaya kapsamlı destek sağlar.

IronBarcode büyük miktarda barkod verisini işleyebilir mi?

Evet, IronBarcode büyük miktarda barkod verisini verimli bir şekilde işlemek için tasarlanmıştır, bu da büyük barkod görevlerini ele alması gereken uygulamalar için uygundur.

Barkod tarama ve üretim için ayrı bir kütüphaneye ihtiyaçım var mı?

Hayır, IronBarcode, masaüstü uygulamaları için geliştirme sürecini basitleştirerek tek bir kütüphane içinde hem barkod tarama hem de üretim işlevlerini sağlar.

IronBarcode'u .NET MAUI ile kullanmak için sistem gereksinimleri nelerdir?

IronBarcode, .NET MAUI ile uyumlu bir .NET ortamı gerektirir. Windows, macOS ve diğer .NET MAUI uygulamalarının çalışabileceği platformları destekler.

IronBarcode barkod doğruluğunu nasıl sağlar?

IronBarcode, hem barkod üretimi hem de taramasında yüksek hassasiyet sağlamak için gelişmiş algoritmalar kullanır, barkod verilerinin kodlanması veya çözülmesindeki hataların olasılığını azaltır.

IronBarcode, ticari ve kişisel projelerde kullanılabilir mi?

Evet, IronBarcode ticari ve kişisel projelerde kullanılabilir ve çeşitli proje gereksinimlerine uygun esnek lisans seçenekleri sunar.

Curtis Chau
Teknik Yazar

Curtis Chau, Bilgisayar Bilimleri alanında lisans derecesine sahiptir (Carleton Üniversitesi) ve Node.js, TypeScript, JavaScript ve React konularında uzmanlaşmış ön uç geliştirme üzerine uzmanlaşmıştır. Kullanıcı dostu ve estetik açıdan hoş arayüzler tasarlamaya tutkuyla bağlı olan Curtis, modern çerç...

Daha Fazlasını Oku
Başlamaya Hazır mısınız?
Nuget İndirmeler 2,169,908 | Sürüm: 2026.4 just released
Still Scrolling Icon

Hala Kaydiriyor musunuz?

Hızlı bir kanit mi istiyorsunuz? PM > Install-Package BarCode
bir örnek çalıştırın dize barkod haline geldiğini görün.