基本信息
源码名称:C# 实现科城打印机自动打印
源码大小:56.93M
文件格式:.rar
开发语言:C#
更新时间:2018-03-01
   友情提示:(无需注册或充值,赞助后即可获取资源下载链接)

     嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):78630559

本次赞助数额为: 2 元 
   源码介绍
实时读取测试文件里面的条码用科城打印机自动打印(含EZ-1100打印机驱动)

  #region 读取配置文件并打印
        //获取配置文件路径
        public static string GetDBDirectory()
        {
            string str = System.Windows.Forms.Application.StartupPath;

            string currentDirectory = str "\\setconfig.txt";

            return currentDirectory;
           
        //读取setconfig文件内容
        public static string ReadFile(string path)
        {
            string str = "";
            using (StreamReader sr = new StreamReader(path, Encoding.Default))
            {
                String line;

                while ((line = sr.ReadLine()) != null)
                {
                    str = line.Trim() Environment.NewLine;

                }
                return str;
            }
        }
        public static void send(string str)//发送字符串到打印机
        {
            
            PrintSn.openport("6"); //Ex:USB
            try
            {
                PrintSn.sendcommand(str);

            }
            catch (Exception error)
            {
                MessageBox.Show(error.Message);
                return;
            }
            finally { PrintSn.closeport(); }

        }
    }
        #endregion