7

私はEpsonTM-U220Aを持っています。領収書を印刷するために、C#デスクトップアプリケーションを作成しています。しかし、プリンターが見つかりません。

メモ帳を介して何かを送信すると、プリンターは奇妙な文字を印刷します(したがって、その動作)

私は次のものを持っています:

  • POS for .Net v1.12.exe
  • OPOSN1.11.16(.net用Esponラッパー)
  • エプソンドライバーがインストールされています
  • プリンターへの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);

設定

4

3 に答える 3

4

私の経験では、Windows プリンタードライバーがインストールされた Epson POS プリンターを使用すると、他の方法でプリンターを使用できなくなります。

最初に試みるべきことは、プリンターを削除し、SetupPOS で再セットアップして、プログラムを再試行することだと思います。

幸運を!

于 2011-08-09T06:37:15.943 に答える
1

configuration.xml ファイルを確認してください。ポート名は、シリアル ポートにある必要がある xml および SetupPOS と同じである必要があります。

xml 構成については、このリンクを確認してください http://social.msdn.microsoft.com/Forums/en-US/5baad480-f2be-4cc9-94e0-572a3fa4697a/sharing-information-for-posnet-112-epson-tmt88v?forum =posfordotnet

于 2013-11-18T10:35:55.987 に答える