zoukankan      html  css  js  c++  java
  • asp.net 条码 一维条码 生成, 一共有32中格式类型

    想用asp.net 实现条码功能,网上找了代码都不全。

    终于找到了一个非常全的DLL 是winForm的,原以为不能用在WEB 上结果 可以使用。

    首先,引用 DLL 不必说了,下面是 使用设置。还有很多设置 参数,自己琢磨咯。

    DLL下载地址  http://pan.baidu.com/s/1jGfwcVc 

    示例代码: http://pan.baidu.com/s/1kT7etvD (WinForm版)

    下图为 ASP.NET 示例代码:

    public ActionResult Test() 
            {
                var bar = new Cobainsoft.Windows.Forms.BarcodeControl();
                bar.AddOnCaption = null;
                bar.AddOnData = null;
                bar.BackColor = System.Drawing.Color.White;
                bar.BarcodeType = Cobainsoft.Windows.Forms.BarcodeType.CODE39;
                bar.Font = new System.Drawing.Font("Arial", 9F);
                bar.ForeColor = System.Drawing.Color.Black;
                bar.HorizontalAlignment = Cobainsoft.Windows.Forms.BarcodeHorizontalAlignment.Center;
                bar.InvalidDataAction = Cobainsoft.Windows.Forms.InvalidDataAction.DisplayInvalid;
                bar.Location = new System.Drawing.Point(3, 3);
                bar.LowerTopTextBy = 0F;
                bar.RaiseBottomTextBy = 0F;
                bar.Size = new System.Drawing.Size(218, 69);
    
    
    
                bar.BarcodeType = Cobainsoft.Windows.Forms.BarcodeType.CODE128C;// 枚举 根据什么格式生成
                bar.ShowCode39StartStop = true;// code39是否有星号
                bar.Data = "88808411"; // 条码数据
                bar.AddOnData = "";// 日期
                bar.TextPosition = Cobainsoft.Windows.Forms.BarcodeTextPosition.Below; // 数据显示在条码底部
                bar.StretchText = true;
                bar.CopyRight = "cydiy";
                
                bar.Invalidate();
                //Stream stream = new FileStream("D://100.png", FileMode.Create, FileAccess.Write, FileShare.None);
                //bar.MakeImage(System.Drawing.Imaging.ImageFormat.Png, 1, 50, true, false, null, stream);
                bar.SaveImage(System.Drawing.Imaging.ImageFormat.Png, 2, 60, true, false, null, "D://1.png");
    
                return null;
            }
  • 相关阅读:
    绕过验证码登陆的方法(适合只需登陆一次可以记住登陆台的网站)
    Throughput Controller(吞吐量控制器) 感觉就像个线程控制器来的
    时间戳 和 日期 转换的方法 (含获取当前时间戳的方法)
    pip使用笔记
    可以模拟多种浏览器的网站
    浏览器兼容性说明
    测试套件的使用
    python 时间对比大小 和 间隔多少天
    django数据库操作
    mysql连接工具记录
  • 原文地址:https://www.cnblogs.com/90nice/p/3724622.html
Copyright © 2011-2022 走看看