2012-07-10 50 views
2

您好我已经在我的系统中安装了Star TSP100 Cutter(TSP143)打印机驱动程序,并测试了打印机,它打印了所有内容。但现在我想通过c#中的代码处理打印机,如剪纸,打印机,打印正常等。我已经使用下面的代码来实例化打印机。当我查询打印机时,它返回null。pos explorer没有找到任何设备连接到C#系统#

任何建议或帮助,如果我走错了路。 谢谢

public static DeviceCollection GetPrinters() 
    { 
     PosExplorer explorer = new PosExplorer(); 
     return explorer.GetDevices(DeviceType.PosPrinter, DeviceCompatibilities.OposAndCompatibilityLevel1); 
    } 

    public static DeviceInfo GetPrinter(string name) 
    { 
     if (String.IsNullOrEmpty(name)) 
      return null; 

     PosExplorer explorer = new PosExplorer(); 
     return explorer.GetDevice(DeviceType.PosPrinter, name); 
    } 
PosExplorer explorer = null; 
       DeviceInfo device = null; 
       PosPrinter printer = null; 
       DeviceCollection printers = GetPrinters(); 

       DeviceInfo printers2 = GetPrinter("Star TSP100 Cutter (TSP143)"); 

回答

1

这听起来像不正确的命令正在发送。 TSP100与Star的其他打印机不同。它需要接收光栅命令。其他打印机通常默认接受线路模式。

参考他们的编程手册这里:http://www.starmicronics.com/support/Mannualfolder/linemode_cm_en.pdf

页87:显示你如何初始化光栅模式

页90:钱箱

页92:进料/切割

+0

我已经解决通过为.Net v1.12重新安装POS的问题..现在它正在寻找打印机,但逻辑上..现在我已将打印机连接到系统并安装该打印机的驱动程序。现在我怎样才能打印物理使用POS探险家.. – 2012-07-11 14:38:04

相关问题