用ASP生成ZT条型码

2016-02-19 18:17 18 1 收藏

下面图老师小编要跟大家分享用ASP生成ZT条型码,简单的过程中其实暗藏玄机,还是要细心学习,喜欢还请记得收藏哦!

【 tulaoshi.com - Web开发 】

  html
  head
  meta http-equiv="Content-Type" content="text/html; charset=gb2312"
  META NAME="Author" CONTENT="haiwa"
  titleAsp生成条形码/title
  /head
  body
  %

  function haiwaocde(zfstr)
  zf = zfstr
  zf = replace(zf,"0","_|_|__||_||_|")
  zf = replace(zf,"1","_||_|__|_|_||")
  zf = replace(zf,"2","_|_||__|_|_||")
  zf = replace(zf,"3","_||_||__|_|_|")
  zf = replace(zf,"4","_|_|__||_|_||")
  zf = replace(zf,"5","_||_|__||_|_|")
  zf = replace(zf,"7","_|_|__|_||_||")
  zf = replace(zf,"6","_|_||__||_|_|")
  zf = replace(zf,"8","_||_|__|_||_|")
  zf = replace(zf,"9","_|_||__|_||_|")
  zf = replace(zf,"a","_||_|_|__|_||")
  zf = replace(zf,"b","_|_||_|__|_||")
  zf = replace(zf,"c","_||_||_|__|_|")
  zf = replace(zf,"d","_|_|_||__|_||")
  zf = replace(zf,"e","_||_|_||__|_|")
  zf = replace(zf,"f","_|_||_||__|_|")
  zf = replace(zf,"g","_|_|_|__||_||")
  zf = replace(zf,"h","_||_|_|__||_|")
  zf = replace(zf,"i","_|_||_|__||_|")
  zf = replace(zf,"j","_|_|_||__||_|")
  zf = replace(zf,"k","_||_|_|_|__||")
  zf = replace(zf,"l","_|_||_|_|__||")
  zf = replace(zf,"m","_||_||_|_|__|")
  zf = replace(zf,"n","_|_|_||_|__||")
  zf = replace(zf,"o","_||_|_||_|__|")
  zf = replace(zf,"p","_|_||_||_|__|")
  zf = replace(zf,"r","_||_|_|_||__|")
  zf = replace(zf,"q","_|_|_|_||__||")
  zf = replace(zf,"s","_|_||_|_||__|")
  zf = replace(zf,"t","_|_|_||_||__|")
  zf = replace(zf,"u","_||__|_|_|_||")
  zf = replace(zf,"v","_|__||_|_|_||")
  zf = replace(zf,"w","_||__||_|_|_|")
  zf = replace(zf,"x","_|__|_||_|_||")
  zf = replace(zf,"y","_||__|_||_|_|")
  zf = replace(zf,"z","_|__||_||_|_|")
  zf = replace(zf,"-","_|__|_|_||_||")
  zf = replace(zf,"*","_|__|_||_||_|")
  zf = replace(zf,"/","_|__|__|_|__|")
  zf = replace(zf,"%","_|_|__|__|__|")
  zf = replace(zf,"+","_|__|_|__|__|")
  zf = replace(zf,".","_||__|_|_||_|")

(本文来源于图老师网站,更多请访问http://www.tulaoshi.com/webkaifa/)

  haiwaocde = zf
  end function
  code_H = 52
  code_W = 2
  function dragcode(ccode)
  c = ccode
  c = replace(c,"_","span style='height:"&code_H&";width:"&code_w&";background:#FFFFFF'/span")
  c = replace(c,"|","span style='height:"&code_H&";width:"&code_w&";background:#000000'/span")
  dragcode = c
  end function

  Function CheckExp(patrn,str)
  Set regEx=New RegExp
  regEx.Pattern=patrn
  regEx.IgnoreCase=true
  regEx.Global=True
  CheckExp = regEx.test(str)
  End Function

(本文来源于图老师网站,更多请访问http://www.tulaoshi.com/webkaifa/)

  code = request("c")

  if code = "" then
  code = "*51windows.net*"
  else
  if Checkexp("^[abcdefghijklmnopqrstuvwxyz1234567890+-*/%$.]*$",code) then
  code = "*"&code&"*"
  else
  code = "*51windows.net*"
  errstr = "brcenter style='color:red;'含有非法字符 /center"
  end if
  end if
  ocode = code
  code = lcase(code)
  %
  centerform name="form1" method="post"合法字符:ABCDEFGHIJKLMNOPQRSTUVWXYZ 1234567890 + - * / % $ .brbrinput name="c" type="text" value="%=request("c")%" size="25" maxlength="15" input type="submit" name="Submit" value="提交"/formcenter
  div align="center"
  center
  table border="0" cellpadding="0" cellspacing="0" height="79"
  tr
  td height="61" align="center"%=dragcode(haiwaocde(code))%/td
  /tr
  tr
  td height="18" align="center" style="text-align:justify;text-justify:Distribute-all-lines;"%=(ocode)%/td
  /tr
  /table
  /center
  /div
  %=errstr%
  /body
  /html

来源:http://www.tulaoshi.com/n/20160219/1617164.html

延伸阅读
标签: ASP
  <% set conn=server.createobject("adodb.connection") conn.open application("connstring") set rs=server.createobject("Adodb.recordset") sql="select * from xxloginteachers order by jsid desc" rs.open sql,conn do while not rs.eof msg=msg & rs("jsid") & ch...
标签: ASP
  表单的验证是开发WEB应用程序中常遇到的一关。有时候我们必须保证表单的某些项必须填写、必须为数字、必须是指定的位数等等,这时候就要用到表单验证了,一般我们常用的表单验证有2种方式: 1、编写JavaScript或VBScript的表单验证函数,在客户端进行验证; 2、在表单提交后,使用ASP的方法Request.Form获取表单的输入值进行判断,...
标签: ASP
使用ASP生成HTML文件 共有两个页面index.htm是首页.程序比较简单,主要是用了ASP里的文件操作对象。   <!--index.htm---------------------- <html <head <titleUntitled Document</title <meta http-equiv="Content-Type" content="text/html; charset=gb2312" </head <body <table width="770" bord...
标签: Web开发
作者: 纯属·印象 Q  Q: 442398600       2006年8月8日 前两天在做一个站内版的企搜引擎,发现某些站点可以链接站点内容。。 奇怪之下看了看,原来是按照数据库ID的自动编号规律进行链接的~~ 闲暇之余弄了下面这个东东,希望对大家在以后的编写ASP程序中有所帮助! % '//生成指定...
标签: Web开发
这篇文章以VB生成的DLL封装ASP代码来连接数据库(以Access数据库为例)。  一般情况下我们在用ASP连接Access的数据库时通常都会进行如下的操作 '//Proconn.asp % dim ProConn set ProConn=Server.CreateObject("ADODB.CONNECTION") ProConn.Open "driver={Microsoft Access Driver (*.mdb)};uid=;pwd=1...

经验教程

252

收藏

66
微博分享 QQ分享 QQ空间 手机页面 收藏网站 回到头部