ByteScout Barcode Reader SDK - C# - Decode Swiss Post Parcel - ByteScout

ByteScout Barcode Reader SDK – C# – Decode Swiss Post Parcel

  • Home
  • /
  • Articles
  • /
  • ByteScout Barcode Reader SDK – C# – Decode Swiss Post Parcel

ByteScout Barcode Reader SDK – C# – Decode Swiss Post Parcel

Program.cs

using System;
using System.IO;

using Bytescout.BarCodeReader;

namespace ReadSwissPostParcel
{
    class Program
    {
        const string ImageFile = "SwissPostParcel.png";

        static void Main()
        {
            Console.WriteLine("Reading barcode(s) from image {0}", Path.GetFullPath(ImageFile));

            Reader reader = new Reader();
            reader.RegistrationName = "demo";
			reader.RegistrationKey = "demo";

            // Set barcode type to find
            reader.BarcodeTypesToFind.Code128 = true; // "Swiss Post Parcel" barcode type is the same as "Code 128"

            // Read barcodes
            FoundBarcode[] barcodes = reader.ReadFrom(ImageFile);

            foreach (FoundBarcode barcode in barcodes)
            {
                Console.WriteLine("Found barcode with type '{0}' and value '{1}'", barcode.Type, barcode.Value);
            }

            Console.WriteLine("Press any key to exit..");
            Console.ReadKey();
        }
    }
}

Tutorials:

prev
next