Link Search Menu Expand Document

Getting Started in Visual Basic .NET

The following sample demonstrates how to read barcode from photo image using Bytescout BarCode Reader SDK for .NET

VB
Imports System.IO

Imports Bytescout.BarCodeReader

Module Module1

    Sub Main()
        Dim imageFile As String = "BarcodePhoto.jpg"
        Console.WriteLine("Reading barcode(s) from image {0}", Path.GetFullPath(imageFile))

        Dim reader As New Reader()
        reader.BarcodeTypesToFind.Code39 = True
        Dim barcodes As FoundBarcode() = reader.ReadFrom(imageFile)

        Dim i As Integer
        For i = 0 To barcodes.Length - 1
            Console.WriteLine("Found barcode with type '{0}' and value '{1}'", barcodes(i).Type, barcodes(i).Value)
        Next

        Console.WriteLine("Press any key to exit..")
        Console.ReadKey()
    End Sub

End Module