Generate Barcodes with ASP

Source: Internet
Author: User

<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<meta name= "Keywords" content= "51windows.net" >
<meta name= "Author" content= "Haiwa" >
<title>asp Generating Barcodes </title>
<style>
<!--
* {Font:menu}
-
</style>

<body>
<%
' Barcode Generation Program
' Hai wa @2004-4-4
' Http://www.51windows.Net
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, ".", "_| | __|_|_|| _|")

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 Dragtext (ccode)
c = Ccode
Dragtext = ""
For I=1 to Len (c)
Dragtext = dragtext& "<span style= ' Width:26;text-align:center ' >" &mid (c,i,1) & "</span>"
Next
Dragtext = Dragtext
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


Code = Request ("C")

If code = "Then
Code = "*51windows.net*"
Else
If Checkexp ("^[abcdefghijklmnopqrstuvwxyz1234567890/+/-/*///%/$/.") *$ ", code) then
Code = "*" &code& "*"
Else
Code = "*51windows.net*"
Errstr = "<br><center style= ' color:red; ' > contains illegal characters </center> "
End If
End If
Ocode = code
Code = LCase (code)
%>
<center><form name= "Form1" method= "post" > Legal characters: ABCDEFGHIJKLMNOPQRSTUVWXYZ 1234567890 +-*/% $. <br>& Lt;br><input name= "C" type= "text" value= "<%=request (" C ")%>" size= "+" maxlength= "> <input type=" Submit "Name=" Submission "value=" ></form><center>
<div align= "center" >
<center>
<table border= "0" cellpadding= "0" cellspacing= "0" height= ">"
<tr>
&LT;TD height= "" align= "center" ><%=dragcode (HAIWAOCDE (code))%></td>
</tr>
<tr>
&LT;TD height= "" align= "center" style= "Text-align:justify;text-justify:distribute-all-lines;" ><%= (Ocode)%></td>
</tr>
</table>
</center>
</div>
<%=errstr%>
</body>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.