2011-07-28 27 views
7

私はEpson TM-U220Aを持っています。領収書を印刷するために私は書いており、C#デスクトップアプリケーションです。しかし、それはプリンタを見つけることができません。私はメモ帳を経由して(したがって、その作業)Epson Point of Sale Printer - C#

を何かを送信する場合

プリンタのプリント奇妙なキャラクターを持っている私は、以下:.NET用

  • POSは
  • OPOSN1.11.16をv1.12.exe (エスポンラッパーfor .net)
  • エスポンドライバーがインストールされて
  • プリンターへのUSBインターフェイス。

コード:

private void FormLoad(object sender, System.EventArgs e) 
     { 

      //<<<step1>>>--Start 
      //Use a Logical Device Name which has been set on the SetupPOS. 
      string strLogicalName = "PosPrinter"; 
      // string strLogicalName = "ESDPRT001"; 

      try 
      { 
       //Create PosExplorer 
       PosExplorer posExplorer = new PosExplorer(); 

       DeviceInfo deviceInfo = null; 

       try 
       { 
        deviceInfo = posExplorer.GetDevice(DeviceType.PosPrinter, strLogicalName); 
        m_Printer = (PosPrinter)posExplorer.CreateInstance(deviceInfo); 
       } 
       catch (Exception) 
       { 
        ChangeButtonStatus(); 
        return; 
       } 

       //Open the device 
       m_Printer.Open(); 

       //Get the exclusive control right for the opened device. 
       //Then the device is disable from other application. 
       m_Printer.Claim(1000); 

       //Enable the device. 
       m_Printer.DeviceEnabled = true; 
      } 
      catch (PosControlException) 
      { 
       ChangeButtonStatus(); 
      } 
      //<<<step1>>>--End 

     } 

エラー:ポート名が違法である、またはデバイスに接続することができませんでした。 オンライン:m_Printer.Claim(1000);エプソンPOSプリンタは、他の方法でプリンタを使用して、Windowsのプリンタドライバのインストール防止を持って取り組んで私の経験で

Set Up

+5

あなたは知っています。このリンクを確認してください? – ZombieSheep

+0

エラー:ポート名が不正です、またはデバイスに接続できませんでした。オンライン:m_Printer.Claim(1000); –

+1

drfiverはoposやwindowsドライバを使用していますか? – TutuGeorge

答えて

4

まず、プリンタを削除し、SetupPOSでもう一度設定して、もう一度プログラムを試してみてください。

幸運を祈る!

+0

これはそのまま動作します...なぜこれが問題になったのかわかりません。 – aggietech

0

プリンタのプリンタポ​​ートを開放しましたか?議定書は、議定書は「両方」

に設定して1800年に「両方」 81に設定して9100に

9100:それは私たちが開いて次のポートを必要とし、プリンタに対して有効になって...

問題がある可能性があります

関連する問題