如何使用ESC / POS命令用C#? [英] How to use esc/pos command with c#?

查看:1103
本文介绍了如何使用ESC / POS命令用C#?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用ESC / POS命令用C#?我需要这样的格式



但我不能做到这一点的格式。
I尝试了一些代码,但没有用。

 使用(VAR毫秒=新的MemoryStream())
使用(VAR体重=新的BinaryWriter(MS))
{
//重置打印机BWS(NV图像不清零)
bw.Write(AsciiControlChars.Escape);
bw.Write('@');
bw.Write(AsciiControlChars.Newline);
bw.Write(AsciiControlChars.Escape);
bw.Write(_______________________________________________);
bw.Write(AsciiControlChars.Newline);

bw.Write(服务价格数量合计);
bw.Write(----------------------------------------- -------);

bw.Write(AsciiControlChars.GroupSeparator);
bw.Write(V);
bw.Write((字节),66);
bw.Write((字节3)3);
bw.Flush();
//发送转换后的ANSI字符串到打印机。
}


解决方案

您可以检查此链接。我现在使用的,它的作品!



http://www.codeproject.com/Tips/704989/Print-Direct-To-Windows-Printer-EPOS-Receipt
与使用小心,你必须知道热敏打印机ESC / POS命令。如果我没有记错的话,手动命令必须退出随打印机附带的CD中。



亲切的问候



奖励:
http://www.developerfusion.com /工具/转换/ VB到CSHARP /


How to use esc/pos command with c#? i need format like this

but i cannot achieve this format. i tried some codes ,but no use.

        using (var ms = new MemoryStream())
        using (var bw = new BinaryWriter(ms))
        {
            // Reset the printer bws (NV images are not cleared)
            bw.Write(AsciiControlChars.Escape);
            bw.Write('@');
            bw.Write(AsciiControlChars.Newline);
            bw.Write(AsciiControlChars.Escape);
            bw.Write("_______________________________________________");
            bw.Write(AsciiControlChars.Newline);

            bw.Write("Service           Price         Qty       Total");
            bw.Write("------------------------------------------------");

            bw.Write(AsciiControlChars.GroupSeparator);
            bw.Write('V');
            bw.Write((byte)66);
            bw.Write((byte)3);
            bw.Flush();
            // Send the converted ANSI string to the printer.
         }

解决方案

You can check this link. I now using that and It's Works!!

http://www.codeproject.com/Tips/704989/Print-Direct-To-Windows-Printer-EPOS-Receipt Use with careful, you must know ESC/POS command for thermal printer. If I'm not mistaken, the manual command must exit on the CD that came with the printer.

Kind Regards

Bonus: http://www.developerfusion.com/tools/convert/vb-to-csharp/

这篇关于如何使用ESC / POS命令用C#?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆