zoukankan      html  css  js  c++  java
  • IT民工系列——c#驱动任意COM接口的小票机(POS热敏打印机)

    前言:

    我是一名IT民工,热爱计算机 热爱软件。我从事.net平台开发也有几年了,专注c#。熟悉: ORM/RBAC/AOP/OO/持久层/数据流/工作流/信息流/企业系统开发/Excel等解密等。


    我过去几年直到现在的技术积累,希望能帮上各位兄弟。如果各位兄弟看上眼,一元钱用淘宝拍下;在淘宝商品备注留下email和项目的名字;我会邮寄给您代码源码密码和说明文档。

    一元钱不多,希望能节省您的开发时间,也支持鼓励下我。如果兄弟收到了源码,也请保存好,不要放在互联网上,留小弟一条小小路走。我的淘宝用户是:pixysoft ,请确认,不要被恶意者冒用。


    如果各位兄弟有小项目或者小想法,不想自己费神,我也愿意毛遂自荐承担一下,价格你开,只要我能做的就一定答应帮您做好!


    我在此鞠躬感谢了!

    代码目的:

    c#驱动小票机,能够开钱箱、打印销售凭条等。

    代码测试片段:

    代码
    using System;
    using System.Collections.Generic;
    using System.Text;
    using System.IO;
    using System.Threading;

    namespace Pixysoft.ITer.Printer.Zonerich
    {
        
    class Program
        {
            
    static void Main(string[] args)
            {
                Console.WriteLine(
    "测试打开钱箱");

                Test01();

                Console.WriteLine(
    "测试打印小票");

                Test02();

                Console.Read();
            }

            
    public static void Test01()
            {
                
    //打开钱箱操作

                
    string printername = "中崎 AB-58MK";//这个要看打印机配置成什么名字,例如我是中崎 AB-58MK

                RawPrinterHelper.SendStringToPrinter(printername,
        ((
    char)27).ToString() + "p" +
        ((
    char)0).ToString() + ((char)60).ToString() + ((char)255).ToString());
            }

            
    public static void Test02()
            {
                
    //打印票据

                
    //因为直接发送数据给小票机会出现丢失数据问题,所以我一般先把文件保存在本地,然后打印

                
    string printername = "中崎 AB-58MK";//这个要看打印机配置成什么名字,例如我是中崎 AB-58MK

                
    string filename = @"e:\demo.txt";

                
    string content = "hello world";

                File.WriteAllText(filename, content, Encoding.GetEncoding(
    "gb2312"));

                RawPrinterHelper.SendFileToPrinter(printername, filename);
            }
        }
    }

    代码源码下载(box.net提供空间 绝对安全放心):

    http://www.citi-box.com/accessories/temp/Pixysoft.Iter.Printer.Zonerich.rar

    代码资助链接(淘宝):

    http://item.taobao.com/auction/item_detail.htm?item_num_id=2841462688

    本人同时可以帮你代购相关设备:
    3开关钱箱 180元
    中崎热敏单面小票机 650元
  • 相关阅读:
    21.Merge Two Sorted Lists 、23. Merge k Sorted Lists
    34. Find First and Last Position of Element in Sorted Array
    leetcode 20. Valid Parentheses 、32. Longest Valid Parentheses 、301. Remove Invalid Parentheses
    31. Next Permutation
    17. Letter Combinations of a Phone Number
    android 常见分辨率(mdpi、hdpi 、xhdpi、xxhdpi )及屏幕适配注意事项
    oc 异常处理
    oc 类型判断
    oc Delegate
    oc 协议
  • 原文地址:https://www.cnblogs.com/zc22/p/1501747.html
Copyright © 2011-2022 走看看