The USB Barcode Scanner Library is a .NET framework library developed by BasselTech in C#. It allows capturing the barcodes scanned by USB barcode scanners in both C# and VB .NET applications.
- Capture barcodes scanned by USB barcode scanners, even when the application window is out of focus.
- Easily integrate barcode scanning functionality into C# and VB .NET applications.
To build the USB Barcode Scanner Library from source, follow these steps:
-
Clone the repository:
git clone https://github.com/BasselTech/usb-barcode-scanner-lib.git
-
Navigate to the project directory:
cd usb-barcode-scanner-lib
-
Build the project using Visual Studio or the .NET CLI:
-
Using Visual Studio:
- Open the solution file
usb-barcode-scanner-lib.sln
in Visual Studio. - Build the solution (Ctrl+Shift+B).
- Open the solution file
-
Using .NET CLI:
dotnet build
-
-
Once built successfully, the library files will be available in the
bin
directory.
To use the USB Barcode Scanner Library in your C# or VB .NET application, follow these steps:
-
Download the latest release from the Releases page.
-
Extract the downloaded files into your project directory.
-
Add a reference to the library file
USB-Barcode-Scanner.dll
in your C# or VB .NET project. -
Initialize a USB barcode scanner object.
-
Subscribe to the
BarcodeScanned
event to handle scanned barcode data. -
Start capturing barcode scans.
Example usage in C#:
using BasselTech.UsbBarcodeScanner;
// Initialize USB barcode scanner
var scanner = new UsbBarcodeScanner();
// Subscribe to BarcodeScanned event
scanner.BarcodeScanned += (sender, args) =>
{
Console.WriteLine($"Scanned barcode: {args.Barcode}");
};
// Start capturing barcode scans
scanner.Start();
Example usage in VB .NET:
Imports BasselTech.UsbBarcodeScanner
' Initialize USB barcode scanner
Dim scanner As New UsbBarcodeScanner()
' Subscribe to BarcodeScanned event
AddHandler scanner.BarcodeScanned, Sub(sender, args)
Console.WriteLine($"Scanned barcode: {args.Barcode}")
End Sub
' Start capturing barcode scans
scanner.Start()
We welcome contributions from the community! If you'd like to contribute to the USB Barcode Scanner Library, please follow these guidelines:
- Fork the repository.
- Create a new branch:
git checkout -b feature/new-feature
. - Make your changes and commit them:
git commit -am 'Add new feature'
. - Push to the branch:
git push origin feature/new-feature
. - Submit a pull request.
If you encounter any bugs or issues with the USB Barcode Scanner Library, please open an issue on the repository. Include a detailed description of the problem and any relevant information for reproducing it.
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.