我有T-20ESPON打印机,我是初学者,我想打印Hello printer字符串(没有什么工作,我刚刚开始,所以我只想打印一些东西),我从代码开始:
PosExplorer explorer = null;
DeviceInfo _device;
PosPrinter _oposPrinter;
explorer = new PosExplorer();
_device = explorer.GetDevice(DeviceType.PosPrinter);
_oposPrinter = (PosPrinter) explorer.CreateInstance(_device);
_oposPrinter.Open();
_oposPrinter = (PosPrinter) explorer.CreateInstance(_device);
_oposPrinter.Open();
_oposPrinter.Claim(10000);
_oposPrinter.DeviceEnabled = true;
//normal print
_oposPrinter.PrintNormal(PrinterStation.Receipt, "Hello world");但是,当我执行代码时,会弹出以下内容:

发布于 2014-03-20 21:36:41
在爱普生系列中,我使用了OPOS ADK
2-安装程序完成后,我启动了安装程序:Startup -> All Program -> OPOS -> SetupPOS。
3-A去了设备-> POSPrinter
4-右击:添加新设备并填写详细信息
5-在中添加新的LDN,输入一个逻辑名称(我的示例: T20PRINTER)
6-在Visual中,使用相同的代码,但替换:
_device = explorer.GetDevice(DeviceType.PosPrinter);有:
_device = explorer.GetDevice(DeviceType.PosPrinter, "T20PRINTER");您可以确定您正在使用逻辑名调用打印机。
https://stackoverflow.com/questions/22428379
复制相似问题