• linkedu视频
  • 平面设计
  • 电脑入门
  • 操作系统
  • 办公应用
  • 电脑硬件
  • 动画设计
  • 3D设计
  • 网页设计
  • CAD设计
  • 影音处理
  • 数据库
  • 程序设计
  • 认证考试
  • 信息管理
  • 信息安全
菜单
linkedu.com
  • 网页制作
  • 数据库
  • 程序设计
  • 操作系统
  • CMS教程
  • 游戏攻略
  • 脚本语言
  • 平面设计
  • 软件教程
  • 网络安全
  • 电脑知识
  • 服务器
  • 视频教程
  • JavaScript
  • ASP.NET
  • PHP
  • 正则表达式
  • AJAX
  • JSP
  • ASP
  • Flex
  • XML
  • 编程技巧
  • Android
  • swift
  • C#教程
  • vb
  • vb.net
  • C语言
  • Java
  • Delphi
  • 易语言
  • vc/mfc
  • 嵌入式开发
  • 游戏开发
  • ios
  • 编程问答
  • 汇编语言
  • 微信小程序
  • 数据结构
  • OpenGL
  • 架构设计
  • qt
  • 微信公众号
您的位置:首页 > 程序设计 >ASP > 生成EAN13标准的条形码的ASP代码实例

生成EAN13标准的条形码的ASP代码实例

作者: 字体:[增加 减小] 来源:互联网 时间:2017-05-11

通过本文主要向大家介绍了ean13条形码,ean13条形码生成器,ean13条形码字体,ean13条形码生成,ean13条形码字体下载等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com

 Set Dict = CreateObject("Scripting.Dictionary")
 Dict.Add "A", "0001101001100100100110111101010001101100010101111011101101101110001011"
 Dict.Add "B", "0100111011001100110110100001001110101110010000101001000100010010010111"

 Rencode = array("1110010","1100110","1101100","1000010","1011100","1001110","1010000","1000100","1001000","1110100")

 cStart="101"
 cMid="01010"
 cEnd="101"

 if w<2 then w=2
 if h<20 then h=20
 cWidth=w '条码单元宽度
 cHeight=h '条码高度

 '检验条码是否符合标准
 if len(code)<>13 then response.write "必须为13位!":response.end

 for i=1 to 12
  if IsNumeric(mid(code,i,1)) then
   if i mod 2 then
    rsum=rsum+int(mid(code,i,1))
   else
    lsum=lsum+int(mid(code,i,1))
   end if
  else
   response.write "必须为数字码!":response.end
  end if
 next
 if 10-((lsum*3+rsum) mod 10) <> int(right(code,1)) then response.write "此条码错误!":response.end

 

 '转换条码
 Barcode=cStart
 Lmethod=left(code,1)
 'if Lmethod=0 then Lmethod=1
 for i=2 to 7
  barcode = barcode & mid(Dict(Mid(Guide(Lmethod-1),i-1,1)),(7*mid(code,i,1)+1),7)
 next
 barcode=barcode & cMid
 for i=8 to 13
  barcode = barcode & Rencode(mid(code,i,1))
 next
 barcode=barcode & cEnd


 fg="#000000" '条码前景色
 bg="#ffffff" '条码背景色
 response.write "<div style='position:absolute;width:"&cWidth*95+60&"px; height:"&cHeight+30&"px; background:"&bg&";'>"
 '绘制条码
 for x=1 to len(barcode)
  if x<5 or x>92 or (x>46 and x<51)then
   sh=10
  else
   sh=0
  end if

  if mid(barcode,x,1)="1" then
   bColor=fg
  else
   bColor=bg
  end if

  response.write "<div style='position:absolute;left:"&(x-1)*cWidth+30&"px;top:5px;width:"&cWidth&"px;height:"&cHeight+5+sh&"px;background:"&bColor&";'></div>"
 next
 '加入可读数字标签
 response.write "<div style='position:absolute;left:16px;top:"&cHeight+10&"px;background:"&bg&";color:"&fg&";font:12px Verdana;'>"&left(code,1)&"</div>"
 for x=1 to 6
  response.write "<div style='position:absolute;left:"&(x*7+2)*cWidth+22&"px;top:"&cHeight+10&"px;background:"&bg&";color:"&fg&";font:12px Verdana;'>"&mid(code,x+1,1)&"</div>"
  response.write "<div style='position:absolute;left:"&(x*7+47)*cWidth+24&"px;top:"&cHeight+10&"px;background:"&bg&";color:"&fg&";font:12px Verdana;'>"&mid(code,x+7,1)&"</div>"
 next
 response.write "<div style='position:absolute; left:30px;top:"&cHeight+25&"px;width:"&cWidth*95&"px;height:10px;text-align:center;background:#ffffff;border:solid 1px #e5e5e5;font:9px verdana;'>© 2007 by elbo </div>"
 response.write "</div>"
End Function

%> 
<p style="font:12px Verdana">
<span style="text-decoration: none">
<font color="#000000">适用:按照需要生成EAN13标准的条形码</font></span><br />
可以试验以下条码:<br />
9787900420206<br />
9787894954947
</p>
<br />
<form method="post" action="ttt.asp">
 <label>
  <input type="" name="bcode" />
 </label>
 <input type="submit" value="生成条码"/>
</form>
<p align="center"></p>

<p align="center">

<%
if request("bcode")<>"" then
 call ean13(request("bcode"),2,100)
else
 call ean13("1234567890128",2,100)
end if

%>
</br></a>版权所有 </p>

</div>

</div>
分享到:QQ空间新浪微博腾讯微博微信百度贴吧QQ好友复制网址打印

您可能想查找下面的文章:

  • 生成EAN13标准的条形码的ASP代码实例

相关文章

  • 2017-05-11XML相关技术资料
  • 2017-05-11String.indexOf 方法介绍
  • 2017-05-11跨越fso、wsh、 application写文件
  • 2017-05-11asp下制做行背景颜色交替变换的表格
  • 2017-05-11非常不错的flash采集程序测试通过
  • 2017-05-11asp 采集实战代码
  • 2017-05-11ASP编程入门进阶(廿一):DAO SQL之建立数据库表
  • 2017-05-11asp中的rs.open与conn.execute的区别说明
  • 2017-05-11asp截取字符串的两种应用 原创
  • 2017-05-11asp身份证验证代码函数

文章分类

  • JavaScript
  • ASP.NET
  • PHP
  • 正则表达式
  • AJAX
  • JSP
  • ASP
  • Flex
  • XML
  • 编程技巧
  • Android
  • swift
  • C#教程
  • vb
  • vb.net
  • C语言
  • Java
  • Delphi
  • 易语言
  • vc/mfc
  • 嵌入式开发
  • 游戏开发
  • ios
  • 编程问答
  • 汇编语言
  • 微信小程序
  • 数据结构
  • OpenGL
  • 架构设计
  • qt
  • 微信公众号

最近更新的内容

    • asp下去除数组中重复项的方法
    • ASP Access实现网站计数器(访问量)
    • 值得收藏的一些HTML、JavaScript、ASP代码
    • ASP XML操作类代码
    • asp下实现UrlEncoding转换编码的代码
    • asp实现获取MSSQL数据库表指定条件行数的函数
    • asp分页生成html的程序脚本代码
    • 防盗链接ASP函数
    • ASP常用源代码的总结(下)
    • ASP+MSSQL2000 数据库被批量注入后的解决方法第1/2页

关于我们 - 联系我们 - 免责声明 - 网站地图

©2020-2025 All Rights Reserved. linkedu.com 版权所有