• 大小: 461KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-05-09
  • 语言: C#
  • 标签: 佳博条码  C#  实例  源码  

资源简介

自己用到的佳博S-4231 的条码打印机 C#代码测试,应该适用其他型号,适用的TSCLIB.dll。

资源截图

代码片段和文件信息

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;
//public class TSCLIB_DLL
//{
//    [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();

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

//    [DllImport(“TSCLIB.dll“ EntryPoint = “downloadpcx“)]
//    public static extern int downloadpcx(string filename string image_name);

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

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

//    [DllImport(“TSCLIB.dll“ EntryPoint = “printerfont“)]
//    public static extern int printerfont(string x string y string fonttype
//                    string rotation string xmul string ymul
//                    string text);

//    [DllImport(“TSCLIB.dll“ EntryPoint = “printlabel“)]
//    public static extern int printlabel(string set string copy);

//    [DllImport(“TSCLIB.dll“ EntryPoint = “sendcommand“)]
//    public static extern int sendcommand(string printercommand);
//    /// 
//    /// 3. setup(abcdefg)
////说明: 设定标签的宽度、高度、打印速度、打印浓度、传感器类别、gap/black mark
////垂直间距、gap/black mark 偏移距离)
////参数:
////a: 字符串型别,设定标签宽度,单位mm
////b: 字符串型别,设定标签高度,单位mm
////c: 字符串型别,设定打印速度,(打印速度随机型不同而有不同的选项)
////1.0: 每秒1.0 英寸打印速度
////1.5: 每秒1.5 英寸打印速度
////2.0: 每秒2.0 英寸打印速度
////3.0: 每秒3.0 英寸打印速度
////4.0: 每秒4.0 英寸打印速度
////5.0: 每秒5.0 英寸打印速度
////6.0: 每秒6.0 英寸打印速度
////d: 字符串型别,设定打印浓度,
////0~15,数字越大打印结果越黑
////e: 字符串型别,设定使用传感器类别
////0 表示使用垂直间距传感器(gap sensor)
////1 表示使用黑标传感器(black mark sensor)
////f: 字符串型别,设定gap/black mark 垂直间距高度,单位: mm
////g: 字符串型别,设定gap/black mark 偏移距离,单位: mm,此参数若使用一般标签
////时均设为0
//    /// 

//    /// 
//    /// 
//    /// 
//    /// 
//    /// 
//    /// 
//    /// 
//    /// 
//    [DllImport(“TSCLIB.dll“ EntryPoint = “setup“)]
//    public static extern int setup(string width string height
//              string speed string density
//              string 

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-09-04 17:10  WindowsFormsApplication1\
     目录           0  2018-09-05 11:43  WindowsFormsApplication1\WindowsFormsApplication1\
     文件        4284  2018-09-05 11:40  WindowsFormsApplication1\WindowsFormsApplication1\BarCodePrint_test.csproj
     文件        2958  2018-09-04 17:11  WindowsFormsApplication1\WindowsFormsApplication1\Form1.Designer.cs
     文件        5880  2018-09-05 11:36  WindowsFormsApplication1\WindowsFormsApplication1\Form1.cs
     文件        5817  2018-09-04 17:11  WindowsFormsApplication1\WindowsFormsApplication1\Form1.resx
     文件      335360  2015-10-29 11:23  WindowsFormsApplication1\WindowsFormsApplication1\POSDLL.dll
     文件         516  2018-09-04 17:10  WindowsFormsApplication1\WindowsFormsApplication1\Program.cs
     目录           0  2018-09-04 17:10  WindowsFormsApplication1\WindowsFormsApplication1\Properties\
     文件        1471  2018-09-05 10:35  WindowsFormsApplication1\WindowsFormsApplication1\Properties\AssemblyInfo.cs
     文件        2878  2018-09-04 17:10  WindowsFormsApplication1\WindowsFormsApplication1\Properties\Resources.Designer.cs
     文件        5612  2018-09-04 17:10  WindowsFormsApplication1\WindowsFormsApplication1\Properties\Resources.resx
     文件        1111  2018-09-04 17:10  WindowsFormsApplication1\WindowsFormsApplication1\Properties\Settings.Designer.cs
     文件         249  2018-09-04 17:10  WindowsFormsApplication1\WindowsFormsApplication1\Properties\Settings.settings
     文件         133  2018-09-04 17:11  WindowsFormsApplication1\WindowsFormsApplication1\Properties\licenses.licx
     目录           0  2018-09-05 11:48  WindowsFormsApplication1\WindowsFormsApplication1\Service References\
     文件       40960  2007-04-23 22:06  WindowsFormsApplication1\WindowsFormsApplication1\TSCLIB.dll
     文件        5389  2018-09-05 11:38  WindowsFormsApplication1\WindowsFormsApplication1\TSCLIB_DLL.cs
     文件      102400  2015-07-07 16:13  WindowsFormsApplication1\WindowsFormsApplication1\USBPrintDll.dll
     目录           0  2018-09-05 11:36  WindowsFormsApplication1\WindowsFormsApplication1\bin\
     目录           0  2018-09-05 11:36  WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\
     文件       40960  2007-04-23 22:06  WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\TSCLIB.dll
     文件       11264  2018-09-05 11:40  WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.exe
     文件       26112  2018-09-05 11:40  WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.pdb
     文件       11600  2018-09-05 11:40  WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.vshost.exe
     目录           0  2018-09-05 11:48  WindowsFormsApplication1\WindowsFormsApplication1\bin\Release\
     目录           0  2018-09-05 08:48  WindowsFormsApplication1\WindowsFormsApplication1\lib\
     文件      335360  2015-10-29 11:23  WindowsFormsApplication1\WindowsFormsApplication1\lib\POSDLL.dll
     文件       40960  2007-04-23 22:06  WindowsFormsApplication1\WindowsFormsApplication1\lib\TSCLib.dll
     文件      102400  2015-07-07 16:13  WindowsFormsApplication1\WindowsFormsApplication1\lib\USBPrintDll.dll
     目录           0  2018-09-04 17:10  WindowsFormsApplication1\WindowsFormsApplication1\obj\
............此处省略17个文件信息

评论

共有 条评论