SetBarCodeReadType

SetBarCodeReadType(params SingleDecodeType[])

SetSingleDecodeType ketik array untuk pengenalan. Harus dipanggil sebelum metode ReadBarCodes().

public void SetBarCodeReadType(params SingleDecodeType[] barcodeTypes)
ParameterJenisKeterangan
barcodeTypesSingleDecodeType[]ItuSingleDecodeType ketik array untuk dibaca.

Contoh

Contoh ini menunjukkan cara mendeteksi barcode Code39 dan Code128.

[C#]
using (BarCodeReader reader = new BarCodeReader())
{
    reader.SetBarCodeReadType(DecodeType.Code39Standard, DecodeType.Code128);
    reader.SetBarCodeImage(@"c:\test.png");
    foreach (BarCodeResult result in reader.ReadBarCodes())
    {
        Console.WriteLine("BarCode Type: " + result.CodeTypeName);
        Console.WriteLine("BarCode CodeText: " + result.CodeText);
    }
}
[VB.NET]
Using reader As New BarCodeReader()
    reader.SetBarCodeReadType(DecodeType.Code39Standard, DecodeType.Code128)
    reader.SetBarCodeImage("c:\test.png")
    For Each result As BarCodeResult In reader.ReadBarCodes()
        Console.WriteLine("BarCode Type: " + result.CodeTypeName)
        Console.WriteLine("BarCode CodeText: " + result.CodeText)
    Next
End Using

Lihat juga


SetBarCodeReadType(BaseDecodeType)

Mengatur jenis dekode untuk pengenalan. Harus dipanggil sebelum metode ReadBarCodes().

public void SetBarCodeReadType(BaseDecodeType type)
ParameterJenisKeterangan
typeBaseDecodeTypeJenis kode batang yang akan dibaca.

Contoh

Contoh ini menunjukkan cara mendeteksi barcode Code39 dan Code128.

[C#]
using (BarCodeReader reader = new BarCodeReader())
{
    reader.SetBarCodeReadType(new MultyDecodeType(DecodeType.Code39Standard, DecodeType.Code128));
    reader.SetBarCodeImage(@"c:\test.png");
    foreach (BarCodeResult result in reader.ReadBarCodes())
    {
        Console.WriteLine("BarCode Type: " + result.CodeTypeName);
        Console.WriteLine("BarCode CodeText: " + result.CodeText);
    }
}
[VB.NET]
Using reader As New BarCodeReader()
    reader.SetBarCodeReadType(New MultyDecodeType(DecodeType.Code39Standard, DecodeType.Code128))
    reader.SetBarCodeImage("c:\test.png")
    For Each result As BarCodeResult In reader.ReadBarCodes()
        Console.WriteLine("BarCode Type: " + result.CodeTypeName)
        Console.WriteLine("BarCode CodeText: " + result.CodeText)
    Next
End Using

Lihat juga