资源简介

c# 小票打印 佳博3120 源码 openport("Gprinter GP-3120TN"); //Open specified printer driver // setup("35", "25", "4", "8", "0", "1", "0");    //Setup the media size and sensor type info sendcommand("SIZE 30mm,37mm"); clearbuffer(); sendcommand("SET PEEL ON "); sendcommand(" SET TEAR ON "); sendcommand(" SET STRIPPER ON ");

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender EventArgs e)
        {
            openport(“Gprinter  GP-3120TN“);                                           //Open specified printer driver
           // setup(“35“ “25“ “4“ “8“ “0“ “1“ “0“);                             //Setup the media size and sensor type info            
            sendcommand(“SIZE 30mm37mm“);
            clearbuffer();
            sendcommand(“SET PEEL ON “);
            sendcommand(“ SET   TEAR   ON “);
            sendcommand(“ SET   STRIPPER   ON “);
           // sendcommand(“HOME“);
            //Clear image buffer
           //  barcode(“10“ “50“ “128“ “50“ “1“ “0“ “2“ “2“ “010101“); //Drawing barcode
           // printerfont(“30“ “25“ “3“ “0“ “1“ “1“ “158528552 “);        //Drawing printer font
            windowsfont(25 2 38 0 2 0 “ARIAL“ “贵阳机场中转“);
            windowsfont(42 38 35 0 2 0 “ARIAL“ “电子消费券“);
            windowsfont(20 65 30 0 2 0 “ARIAL“ “欢迎选择贵阳中转“);
          
            windowsfont(15 90 30 0 2 0 “ARIAL“ “凭密码:12345678“); //我们提供价值48元就餐券
            windowsfont(15 115 24 0 0 0 “ARIAL“ “到以下地点消费免48元“);  //凭消费密码:1213456789
            windowsfont(12 140 24 0 0 0 “ARIAL“ “1.雅品快港自助餐(连廊)“);
            windowsfont(12 165 24 0 0 0 “ARIAL“ “2.仙姆莱克咖啡(C指廊)“);
            windowsfont(12 190 24 0 0 0 “ARIAL“ “3.欧迪咖啡厅(C指廊)“);
            windowsfont(12 215 22 0 0 0 “ARIAL“ “4.雅品茶餐厅(二楼D岛旁)“);
           //  windowsfont(180 175 24 0 0 0 “ARIAL“ “121345678“);
            barcode(“40“ “240“ “128“ “30“ “1“ “0“ “2“ “2“ “12345678“);
           //  windowsfont(30 200 24 0 0 0 “ARIAL“ “4.雅品茶餐厅(二楼D岛旁)“);
            
            //   sendcommand(“ SET   STRIPPER   ON “);
            printlabel(“1“ “1“);                                                    //Print labels
            closeport();                     
        }

        [DllImport(“TSCLIB.dll“ EntryPoint = “about“)]
        public static extern int about();

        [DllImport(“TSCLIB.dll“ EntryPoint = “openport“)]
        public static extern int openport(string printername);

        [DllImport(“TSCLIB.dll“ EntryPoint = “barcode“)]
        public static extern int barcode(string x string y string type
                    string height string readable string rotation
                    string narrow string wide string code);

        [DllImport(“TSCLIB.dll“ EntryPoint = “clearbuffer“)]
        public static extern int clearbuffer();

        [DllImpor

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      74240  2010-07-20 09:49  WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\TSCLib.dll

     文件      11264  2014-07-08 10:19  WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.exe

     文件      28160  2014-07-08 10:19  WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.pdb

     文件      11600  2014-07-09 15:32  WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.vshost.exe

     文件        490  2010-03-17 22:39  WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.vshost.exe.manifest

     文件       5229  1996-05-09 08:49  WindowsFormsApplication1\WindowsFormsApplication1\bin\UL.PCX

     文件       6751  2014-07-08 10:19  WindowsFormsApplication1\WindowsFormsApplication1\Form1.cs

     文件       3913  2014-07-02 21:38  WindowsFormsApplication1\WindowsFormsApplication1\Form1.Designer.cs

     文件       5817  2014-07-02 21:38  WindowsFormsApplication1\WindowsFormsApplication1\Form1.resx

     文件       4440  2014-07-07 15:56  WindowsFormsApplication1\WindowsFormsApplication1\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache

     文件       6478  2014-07-08 10:19  WindowsFormsApplication1\WindowsFormsApplication1\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache

     文件        588  2014-07-02 21:38  WindowsFormsApplication1\WindowsFormsApplication1\obj\x86\Debug\GenerateResource.read.1.tlog

     文件       1342  2014-07-02 21:38  WindowsFormsApplication1\WindowsFormsApplication1\obj\x86\Debug\GenerateResource.write.1.tlog

     文件       7897  2014-07-07 15:56  WindowsFormsApplication1\WindowsFormsApplication1\obj\x86\Debug\ResolveAssemblyReference.cache

     文件       1564  2014-07-09 15:32  WindowsFormsApplication1\WindowsFormsApplication1\obj\x86\Debug\WindowsFormsApplication1.csproj.FileListAbsolute.txt

     文件      11264  2014-07-08 10:19  WindowsFormsApplication1\WindowsFormsApplication1\obj\x86\Debug\WindowsFormsApplication1.exe

     文件        180  2014-07-02 21:38  WindowsFormsApplication1\WindowsFormsApplication1\obj\x86\Debug\WindowsFormsApplication1.Form1.resources

     文件      28160  2014-07-08 10:19  WindowsFormsApplication1\WindowsFormsApplication1\obj\x86\Debug\WindowsFormsApplication1.pdb

     文件        180  2014-07-02 17:27  WindowsFormsApplication1\WindowsFormsApplication1\obj\x86\Debug\WindowsFormsApplication1.Properties.Resources.resources

     文件        505  2014-07-02 16:41  WindowsFormsApplication1\WindowsFormsApplication1\Program.cs

     文件       1390  2014-07-02 16:41  WindowsFormsApplication1\WindowsFormsApplication1\Properties\AssemblyInfo.cs

     文件       2899  2014-07-02 16:41  WindowsFormsApplication1\WindowsFormsApplication1\Properties\Resources.Designer.cs

     文件       5612  2014-07-02 16:41  WindowsFormsApplication1\WindowsFormsApplication1\Properties\Resources.resx

     文件       1110  2014-07-02 16:41  WindowsFormsApplication1\WindowsFormsApplication1\Properties\Settings.Designer.cs

     文件        249  2014-07-02 16:41  WindowsFormsApplication1\WindowsFormsApplication1\Properties\Settings.settings

     文件      40960  2007-04-23 22:06  WindowsFormsApplication1\WindowsFormsApplication1\TSCLib.dll

     文件       3707  2014-07-02 16:42  WindowsFormsApplication1\WindowsFormsApplication1\WindowsFormsApplication1.csproj

     文件        914  2014-07-02 16:41  WindowsFormsApplication1\WindowsFormsApplication1.sln

    ..A..H.     22528  2014-07-09 15:31  WindowsFormsApplication1\WindowsFormsApplication1.suo

     目录          0  2014-07-02 16:41  WindowsFormsApplication1\WindowsFormsApplication1\obj\x86\Debug\TempPE

............此处省略11个文件信息

评论

共有 条评论