IronBarcode'u Azure'da .NET ile Çalıştırabilir miyim?

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

Evet! IronBarcode, Azure hizmetlerinde barındırılan .NET uygulamalarında QR/çubuk kodları okumak ve yazmak için kullanılabilir. IronBarcode, MVC web siteleri, Azure İşlevleri ve daha fazlası dahil olmak üzere birden fazla Azure platformunda kapsamlı bir şekilde test edilmiştir.


Ön Koşullar

1. Başlamak için IronBarcode'u Yükleyin

Öncelikle NuGet web sitesinden NuGet paketini yükleyin.

Install-Package BarCode

As an alternative, the IronBarcode.dll could also be downloaded and added to your project.


Nasıl Rehberi

2. Performans ve Azure Katmanları

Kullanıcılarımızın çoğunun kullanım durumları için uygun olduğu için en azından Azure B1 hizmet planını kullanmanızı öneririz. Daha yüksek verimlilik gerektiren sistemler daha yüksek bir hizmet planı gerektirecektir.

3. Çerçeve Seçimi

.NET Standard, Core ve Framework projeleri IronBarcode ile uyumludur.

4. Azure'da Docker

Azure'da IronBarcode ile performans ve kararlılığı kontrol etme yeteneğini kazanmanın yollarından biri Docker kullanmaktır. Azure ve Docker ile IronBarcode kullanmayı öğrenmek için bu rehbere göz atın.

5. Resmi Azure İşlev Desteği

IronBarcode, Azure İşlevleri V3 ve V4'ü şu anda desteklemektedir.

Çalışan Azure İşlev Kodu Örneği

Azure İşlevleri v3.3.1.0+'da test edilmiştir. İşte bir kod örneği:

using System;
using System.Net;
using System.Net.Http;
using IronBarCode;
using Microsoft.AspNetCore.Http;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Extensions.Http;
using Microsoft.Extensions.Logging;
using System.Net.Http.Headers;

public static class BarcodeFunction
{
    // Azure Function triggered by HTTP request.
    [FunctionName("barcode")]
    public static HttpResponseMessage Run(
        [HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)] HttpRequest req,
        ILogger log)
    {
        log.LogInformation("C# HTTP trigger function processed a request.");

        // Set the license key for IronBarcode if needed.
        IronBarCode.License.LicenseKey = "Key";

        // Create a QR barcode from a string.
        var myBarCode = BarcodeWriter.CreateBarcode("IronBarcode Test", BarcodeEncoding.QRCode);

        // Prepare the HTTP response to return the barcode image.
        var response = new HttpResponseMessage(HttpStatusCode.OK)
        {
            Content = new ByteArrayContent(myBarCode.ToJpegBinaryData())
        };

        // Set content headers for attachment and content type.
        response.Content.Headers.ContentDisposition = new ContentDispositionHeaderValue("attachment")
        { 
            FileName = $"{DateTime.Now:yyyyMMddmm}.jpg" 
        };

        response.Content.Headers.ContentType = new MediaTypeHeaderValue("image/jpeg");

        return response;
    }
}
using System;
using System.Net;
using System.Net.Http;
using IronBarCode;
using Microsoft.AspNetCore.Http;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Extensions.Http;
using Microsoft.Extensions.Logging;
using System.Net.Http.Headers;

public static class BarcodeFunction
{
    // Azure Function triggered by HTTP request.
    [FunctionName("barcode")]
    public static HttpResponseMessage Run(
        [HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)] HttpRequest req,
        ILogger log)
    {
        log.LogInformation("C# HTTP trigger function processed a request.");

        // Set the license key for IronBarcode if needed.
        IronBarCode.License.LicenseKey = "Key";

        // Create a QR barcode from a string.
        var myBarCode = BarcodeWriter.CreateBarcode("IronBarcode Test", BarcodeEncoding.QRCode);

        // Prepare the HTTP response to return the barcode image.
        var response = new HttpResponseMessage(HttpStatusCode.OK)
        {
            Content = new ByteArrayContent(myBarCode.ToJpegBinaryData())
        };

        // Set content headers for attachment and content type.
        response.Content.Headers.ContentDisposition = new ContentDispositionHeaderValue("attachment")
        { 
            FileName = $"{DateTime.Now:yyyyMMddmm}.jpg" 
        };

        response.Content.Headers.ContentType = new MediaTypeHeaderValue("image/jpeg");

        return response;
    }
}
Imports System
Imports System.Net
Imports System.Net.Http
Imports IronBarCode
Imports Microsoft.AspNetCore.Http
Imports Microsoft.Azure.WebJobs
Imports Microsoft.Azure.WebJobs.Extensions.Http
Imports Microsoft.Extensions.Logging
Imports System.Net.Http.Headers

Public Module BarcodeFunction
	' Azure Function triggered by HTTP request.
	<FunctionName("barcode")>
	Public Function Run(<HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route := Nothing)> ByVal req As HttpRequest, ByVal log As ILogger) As HttpResponseMessage
		log.LogInformation("C# HTTP trigger function processed a request.")

		' Set the license key for IronBarcode if needed.
		IronBarCode.License.LicenseKey = "Key"

		' Create a QR barcode from a string.
		Dim myBarCode = BarcodeWriter.CreateBarcode("IronBarcode Test", BarcodeEncoding.QRCode)

		' Prepare the HTTP response to return the barcode image.
		Dim response = New HttpResponseMessage(HttpStatusCode.OK) With {.Content = New ByteArrayContent(myBarCode.ToJpegBinaryData())}

		' Set content headers for attachment and content type.
		response.Content.Headers.ContentDisposition = New ContentDispositionHeaderValue("attachment") With {.FileName = $"{DateTime.Now:yyyyMMddmm}.jpg"}

		response.Content.Headers.ContentType = New MediaTypeHeaderValue("image/jpeg")

		Return response
	End Function
End Module
$vbLabelText   $csharpLabel

Bu kodda:

  • "barcode" adıyla bir Azure İşlevi tanımlarız.
  • İşlev bir HTTP isteğiyle tetiklenir ve işlendiğinde bir mesaj kaydeder.
  • IronBarcode için lisans anahtarını belirtiriz ("Key" kısmını gerçek lisans anahtarınızla değiştirin).
  • BarcodeWriter.CreateBarcode kullanılarak bir QR kodu BARCODE oluşturulur.
  • Çubuk kod görüntüsü JPEG formatına dönüştürülür ve HTTP yanıtına dahil edilir.
  • Yanıt içeriği, dosya adı olarak geçerli tarih ve saatle bir indirilebilir ek olarak ayarlanır.
  • Yanıt içerik türü, görüntü formatını belirtmek için "image/jpeg" olarak ayarlanır.

Sıkça Sorulan Sorular

Azure uygulamalarıma barkod işlevselliğini nasıl entegre edebilirim?

Azure uygulamalarınıza barkod işlevselliğini IronBarcode kullanarak entegre edebilirsiniz. Komut satırıyla veya IronBarcode.dll dosyasını indirip projenize ekleyerek IronBarcode NuGet paketini yükleyerek başlayın.

Azure üzerinde barkod işlemleri için hangi Azure hizmet planları uygundur?

IronBarcode kullanırken, çoğu kullanım senaryosu için Azure B1 hizmet planı önerilmektedir. Eğer uygulamanız daha yüksek veri akışı gerektiriyorsa, daha üst bir hizmet planına geçmeyi düşünebilirsiniz.

IronBarcode, Azure üzerinde tüm .NET frameworkleriyle uyumlu mu?

Evet, IronBarcode, .NET Standard, Core ve Framework projeleriyle uyumludur ve Azure üzerinde uygulamaların dağıtılmasında esneklik sağlar.

Barkod işleme performansını Azure üzerinde artırmak için Docker kullanabilir miyim?

Evet, Azure üzerinde barkod işleme performans ve kararlılığını artırmak için Docker kullanabilirsiniz. IronBarcode'u Docker ile entegre etme hakkında detaylı bir eğitim mevcuttur.

IronBarcode kütüphaneleri Azure Functions'ı destekliyor mu?

IronBarcode, Azure Fonksiyonları V3 ve V4'ü destekler. Sunucusuz ortamlarda barkod işleme entegrasyonunu sorunsuz bir şekilde sağlar.

Azure Function, IronBarcode kullanarak barkodları nasıl işler?

Azure Function, IronBarcode kullanarak HTTP isteği ile tetiklendiğinde bir QR kod oluşturacak şekilde ayarlanabilir. Bir mesaj kaydedip, bir lisans anahtarı ayarlar, BarcodeWriter.CreateBarcode ile bir QR kod oluşturarak, bu resmi bir JPEG dosyası olarak HTTP yanıtına ekleyerek döndürür.

Azure Function'da QR kodu oluşturmak için hangi kod gerekli?

Azure Function'da, BarcodeWriter.CreateBarcode fonksiyonu çağrılarak IronBarcode kullanarak bir QR kodu oluşturulur. Oluşturulan QR kodu daha sonra HTTP yanıtında bir JPEG resim olarak iade edilebilir.

IronBarcode hem 1D hem de 2D barkodları işleyebilir mi?

IronBarcode, basit ürün etiketlemeden karmaşık veri kodlamaya kadar geniş bir yelpazede uygulamayı destekleyen hem 1D hem de 2D barkodları işleyebilir.

IronBarcode'un ticari kullanımı için lisans seçenekleri var mı?

Iron Software, IronBarcode için ticari lisanslar dahil olmak üzere çeşitli lisanslama seçenekleri sunar, işletme gereksinimleri ile uyum sağlanmasını garanti eder.

IronBarcode, barkodların toplu işlenmesini destekliyor mu?

Evet, IronBarcode toplu işlemeyi destekler, bu da geliştiricilerin büyük ölçekli uygulamalar için verimliliği artırarak tek bir işlemde birden fazla barkod oluşturmasını veya okumasını sağlar.

Curtis Chau
Teknik Yazar

Curtis Chau, Bilgisayar Bilimleri alanında Lisans Derecesine (Carleton Üniversitesi) sahip ve Node.js, TypeScript, JavaScript ve React konularında uzmanlaşmış ön uç geliştirmeyle ilgileniyor. Sezgisel ve estetik açıdan hoş kullanıcı arayüzleri oluşturma tutkunu, Curtis modern çerçevelerle çalışmayı ve iyi yapı...

Daha Fazla Oku
Başlamaya Hazır mısınız?
Nuget İndirmeler 2,240,258 | Sürüm: 2026.5 just released
Still Scrolling Icon

Hâlâ Kaydırıyor Musunuz?

Hızlıca kanıt ister misiniz? PM > Install-Package BarCode
bir örnek çalıştır dizginizin barkoda dönüştüğünü izle.