C#生成条码图片,并用条码打印机打印

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using System.Drawing;
using System.Drawing.Imaging;
using System.Collections;
using System.Text.RegularExpressions;
using System.Windows.Forms;

/// <summary>
/// code39 的摘要说明
/// </summary>
public class code39
{
    private Hashtable Decode;
    private Hashtable CheckCode;
    //每個字元間的間隔符
    private string SPARATOR = "0";
    public int WidthCU = 3;  //粗線和寬間隙寬度
    public int WidthXI = 1;  //細線和窄間隙寬度
    public int xCoordinate = 10;//75;  //條碼起始座標
    public int LineHeight = 60;
    private int Height = 0;
    private int Width = 0;
    private string _barcode = "";

 public code39()
 {
  //
  // TODO: 在此处添加构造函数逻辑
  //
        Decode = new Hashtable();
        Decode.Add("0", "000110100");
        Decode.Add("1", "100100001");
        Decode.Add("2", "001100001");
        Decode.Add("3", "101100000");
        Decode.Add("4", "000110001");
        Decode.Add("5", "100110000");
        Decode.Add("6", "001110000");
        Decode.Add("7", "000100101");
        Decode.Add("8", "100100100");
        Decode.Add("9", "001100100");
        Decode.Add("A", "100001001");
        Decode.Add("B", "001001001");
        Decode.Add("C", "101001000");
        Decode.Add("D", "000011001");
        Decode.Add("E", "100011000");
        Decode.Add("F", "001011000");
        Decode.Add("G", "000001101");
        Decode.Add("H", "100001100");
        Decode.Add("I", "001001101");
        Decode.Add("J", "000011100");
        Decode.Add("K", "100000011");
        Decode.Add("L", "001000011");
        Decode.Add("M", "101000010");
        Decode.Add("N", "000010011");
        Decode.Add("O", "100010010");
        Decode.Add("P", "001010010");
        Decode.Add("Q", "000000111");
        Decode.Add("R", "100000110");
        Decode.Add("S", "001000110");
        Decode.Add("T", "000010110");
        Decode.Add("U", "110000001");
        Decode.Add("V", "011000001");
        Decode.Add("W", "111000000");
        Decode.Add("X", "010010001");
        Decode.Add("Y", "110010000");
        Decode.Add("Z", "011010000");
        Decode.Add("-", "010000101");
        Decode.Add("%", "000101010");
        Decode.Add("$", "010101000");
        Decode.Add("*", "010010100");

        CheckCode = new Hashtable();
        CheckCode.Add("0", "0");
        CheckCode.Add("1", "1");
        CheckCode.Add("2", "2");
        CheckCode.Add("3", "3");
        CheckCode.Add("4", "4");
        CheckCode.Add("5", "5");
        CheckCode.Add("6", "6");
        CheckCode.Add("7", "7");
        CheckCode.Add("8", "8");
        CheckCode.Add("9", "9");
        CheckCode.Add("A", "10");
        CheckCode.Add("B", "11");
        CheckCode.Add("C", "12");
        CheckCode.Add("D", "13");
        CheckCode.Add("E", "14");
        CheckCode.Add("F", "15");
        CheckCode.Add("G", "16");
        CheckCode.Add("H", "17");
        CheckCode.Add("I", "18");
        CheckCode.Add("J", "19");
        CheckCode.Add("K", "20");
        CheckCode.Add("L", "21");
        CheckCode.Add("M", "22");
        CheckCode.Add("N", "23");
        CheckCode.Add("O", "24");
        CheckCode.Add("P", "25");<

  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 6
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值