2012-07-10 75 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