zoukankan      html  css  js  c++  java
  • vb.net winform pos机并口打印机打印以及开钱箱。。。。

    代码
    '打印功能 
    public sub MyPrint()
    Dim objfs, objprinter
            objfs 
    = CreateObject("Scripting.FileSystemObject")
            objprinter 
    = objfs.CreateTextFile("LPT1:"True)
            objprinter.Writeline(
    "           俺家大饭店          " + Chr(10))
            objprinter.Writeline(
    "--------------------------------" + Chr(10))
            objprinter.Writeline(
    "编号    名称      单价   数量" + Chr(10))
            objprinter.Writeline(
    "                                 " + Chr(10))
            
    For i = 0 To dt.Rows.Count - 1
                objprinter.Writeline(
    " " & i + 1 & "      " & dt.Rows(i).Item(1& "        " & dt.Rows(i).Item(2& "      " & dt.Rows(i).Item(3& " " + Chr(10))
            
    Next
            objprinter.Writeline(
    "--------------------------------" + Chr(10))
            objprinter.Writeline(
    "共计:" & frmHmain.Tolmoney & "元|付款:" & txtFK.Text & "元|找零:" & lblzl.Text & " 元" + Chr(10))
            objprinter.Writeline(
    "--------------------------------" + Chr(10))
            objprinter.Writeline(
    "打印日期:    " + Date.Now + Chr(10))
            objprinter.Writeline(
    "--------------------------------" + Chr(10))
            objprinter.Writeline(
    "欢迎您再次光临,谢谢。请慢走!" + Chr(10))
            objprinter.Writeline(
    Chr(10))
            objprinter.Writeline(
    Chr(10))
            objprinter.Writeline(
    Chr(10))
            objprinter.close()
            objprinter 
    = Nothing
            objfs 
    = Nothing
    End sub
    Public Shared Sub OpenBox() '打开钱箱
            Dim objfs, objprinter
            objfs 
    = CreateObject("Scripting.FileSystemObject")
            objprinter 
    = objfs.CreateTextFile("LPT1:"True)
            objprinter.Writeline((
    Chr(27)).ToString() + "p" + (Chr(0)).ToString() + ((Chr(60))).ToString() + ((Chr(255))).ToString())
            objprinter.close()
            objprinter 
    = Nothing
            objfs 
    = Nothing
        
    End Sub 


  • 相关阅读:
    数据转换类型和算数运算符
    语言基础+数据类型
    JS(一)Prototype的使用
    Jquery EasyUI简介和数据的增删改查
    http简介
    《JavaScript语言精粹》笔记
    wcf
    简单工厂模式与抽象工厂模式
    <转载>C#中的特性(Attributes)
    <转载>C#IEnumerable和IEnumerator 详解
  • 原文地址:https://www.cnblogs.com/Believeme/p/1566576.html
Copyright © 2011-2022 走看看