This sample was designed to be run from the command line. We have included options to search for a specific barcode type, list all supported barcode types, and print how to use this sample. The only requirement is that you specify a path to the image you want to scan for barcodes.
Command Line Interface (CLI)
To run the sample using the .Net CLI, use the "dotnet run" command and specify an image path. This will build and run the sample.
Run the sample
dotnet run path/to/your/image.jpg
Scan for a specific barcode type
dotnet run -t QRCode path/to/your/image.bmp
Scan for more than one barcode type
dotnet run -t QRCode -t Aztec path/to/your/image.png
List all the barcode types
dotnet run -l
Print usage
dotnet run -u
Visual Studio
To run the sample using Visual Studio:
-
Open the solution, right-click on the ReadBarcodes project in the Solution Explorer, select Properties, and then click on the Debug tab.
-
In the Application arguments text box:
- Specify an image path (required)
- Enter values for all the optional arguments, as required
-
After you have specified an image path and any additional arguments, press CTRL+F5 to run the sample.
Example Application Arguments
The following are examples showing how to use the Application arguments for this sample.
Run the sample
path/to/your/image.jpg
Scan for a specific barcode type
-t QRCode path/to/your/image.bmp
Scan for more than one barcode type
-t QRCode -t Aztec path/to/your/image.png
List all the barcode types
-l
Print usage
-u
