[英]pos explorer is not finding any device connected to the system in C#
嗨,我已經在系統中安裝了Star TSP100 Cutter(TSP143)打印機驅動程序,並測試了打印機,它可以打印所有內容。 但是現在我想通過c#中的代碼來處理打印機,例如切紙,打開打印機,普通打印等。我已經使用以下代碼實例化打印機。 當我查詢打印機時,它返回null。
任何建議或幫助,如果我走錯了路。 謝謝
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)");
聽起來好像發送了不正確的命令。 TSP100與Star系列中的其他打印機不同。 它需要接收柵格命令。 默認情況下,其他打印機通常接受行模式。
在此處參考他們的編程手冊: http : //www.starmicronics.com/support/Mannualfolder/linemode_cm_zh.pdf
頁面87:向您展示如何初始化光柵模式
Page 90:現金抽屜
Page 92:提要/剪切
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.