The barcode scanner looks for barcodes in this case if it finds the barcode it returns the 3 required elements. However, if it doesn't it returns empty array. Therefor all we need to do is add an if else statment.
public String ReadBarcodeFromFile(string _Filepath)
{
if(barcodes.Length!= 0)
{
String[] barcodes = BarcodeScanner.Scan(_Filepath, BarcodeType.Code39);
return barcodes[0];
}
else
{
return false;
}
}
Something within those lines or however you want the if else to preform/do. hope this helps someone.