I'm use c# (VS2010, dot net ver4.0 client profile).
Barcode.net version is 6.6.0
I was buy it at this week.
and I downloaded it 1st Dec. 2014. ( a few days ago. )
first of all, Review simple code.
--------- Begin my CODE -----------------
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Aspose.BarCode;
using Aspose.BarCodeRecognition;
namespace BarcodeReader
{
public partial class cBarcodeReader : Form
{
cBarcode myBar;
public cBarcodeReader()
{
InitializeComponent();
myBar = new cBarcode();
MessageBox.Show(myBar.GetBarcode(@"D:\barcode\TestImg.bmp"));
this.Close ();
}
}
class cBarcode {
public cBarcode() {
Aspose.BarCode.License lic = new Aspose.BarCode.License();
lic.SetLicense(@"D:\barcode\Aspose.BarCode.lic");
}
public string GetBarcode(string filename) {
string ret = "";
BarCodeReader br = new BarCodeReader(filename, BarCodeReadType.Code128 |
BarCodeReadType.DeutschePostIdentcode |
BarCodeReadType.DeutschePostLeitcode |
BarCodeReadType.QR);
if (br.Read()) ret = br.GetCodeText(); // get only first code/
br.Close();
return ret;
}
}
}
--------- Finish my CODE -----------------
when I run this code (both debug and release mode). I got a InvalidOperationException at br.Read().
I don't know why.
please solve it.
Help me.