Barcode Reader CLI
Integration
C#
C#
brcli-example.config
1using System;
2using System.IO;
3using System.Runtime.CompilerServices;
4
5string[] args = {
6"-type=code128",
7"https://wabr.inliteresearch.com/SampleImages/1d.pdf",
8"@\"./brcli-example.config\"" // Additional options and sources in configuration file
9};
10
11string output;
12string error;
13
14using (Process proc = new Process())
15{
16 proc.StartInfo = new ProcessStartInfo {
17 FileName = "./BarcodeReaderCLI",
18 Arguments = string.Join(" ", args),
19 UseShellExecute = false,
20 RedirectStandardOutput = true,
21 RedirectStandardError = true,
22 };
23 proc.Start();
24 error = proc.StandardError.ReadToEnd();
25 output = proc.StandardOutput.ReadToEnd();
26 proc.WaitForExit();
27};
28
29if (output != "") Console.WriteLine("STDOUT:\n" + output);
30if (error != "") Console.WriteLine("STDERR:\n" + error);