Код: Выделить всё
public void ImprintHelloPrinter()
{
//The Explorer
PosExplorer explorer = new PosExplorer();
////Get the device by its type LOGICAL NAME
DeviceInfo device = explorer.GetDevice(DeviceType.PosPrinter, "T20PRINTER");
//Create an instance
PosPrinter oposPrinter = (PosPrinter)explorer.CreateInstance(device);
//Opening
MessageBox.Show(@"Statue : " + oposPrinter.State.ToString());
oposPrinter.Open();
MessageBox.Show(@"Statue : " + oposPrinter.State.ToString());
//Checking if its really the printer
MessageBox.Show(@"Description : " + oposPrinter.DeviceDescription);
MessageBox.Show(@"Check Claimed : " + oposPrinter.Claimed.ToString());
oposPrinter.Claim(10000); //Here is My Exception
//Enabeling device
oposPrinter.DeviceEnabled = true;
//normal print
oposPrinter.PrintNormal(PrinterStation.Receipt, "Hello Printer");
}
Код: Выделить всё
Method ClaimDevice threw an exception. Attempt was made to perform an illegal
or unsupported operation with the device, or an invalid parameter value was used.
Код: Выделить всё
POSControlException ErrorCode(Illegal) ExtendedErrorCode(10002) occurred:
Method ClaimDevice threw an exception. Attempt was made to perform an illegal
or unsupported operation with the device, or an invalid parameter value was
used.

Подробнее здесь: https://stackoverflow.com/questions/224 ... posprinter
Мобильная версия