Hello all, I am trying to receive data from a magnetic card using
fieldsoftwares printerce and am having a hard time. Has anyone done this?
If so, could you look at my code below and let me know what I am doing
wrong? Thanks
public string test()
{
AsciiCE asciice = null;
FieldSoftware.PrinterCE_NetCF.AsciiCE.READ_RESULT result = new
FieldSoftware.PrinterCE_NetCF.AsciiCE.READ_RESULT();
string strResults;
try
{
asciice = new AsciiCE("XXXXXX"); //Create instance of AsciiCE class
asciice.SetupPrinter(FieldSoftware.PrinterCE_NetCF.PrinterCE_Base.PRINTER.EX
TECH_3,FieldSoftware.PrinterCE_NetCF.PrinterCE_Base.PORT.INFRARED,true);
asciice.SelectPort(AsciiCE.ASCIIPORT.INFRARED); //Print with Infrared port
********This next line is where it dies and creates and error stating
"Unable to complete printing task"******************
strResults = asciice.ReadString(asciice.Peek(),true,0,ref result);
asciice.ClosePort(); //Finish printing and close printing port
return strResults;
}
catch (PrinterCEException exc)
{
strResults = result.ToString();
MessageBox.Show("AsciiCE Exception" + strResults + " " +
exc.Message.ToString(),"Exception");
return strResults;
}
finally //Make sure we call ShutDown()
{
if (asciice!=null)
{
asciice.ShutDown(); //Done - free PrinterCE resources
}
asciice=null;
}
}