An example code for generating a barcode with an ASP. (Note: The generated graphic is HTML code, not the picture, when printing, please in IE Internet option => Advanced = "Print Selected" Print Background Color and Image ")
Demo Address: http://www.51windows.net/myfile/asp/codeflag.asp
The simpler method is to use a barcode font, download: http://www.51windows.net/2004/share/font/tiaoma.rar (if the address can't download, please search "bar code font" on Google).
* {font: menu}
->
style>
hEAD>
<%
'Barcode generation program
'海娃 @ 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>") c = replace (c, "|", span> ")
Dragcode = C
END FUNCTION
Function Dragtext (CCODE)
C = ccode
DRAGTEXT = "" "
For i = 1 to len (c)
Dragtext = Dragtext & "" & 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 = "" "
CODE = "* 51windows.net *"
Else
If Checkeexp ("^ [AbcdefghijklmnopQrstuvwxyz1234567890 / //*///%/$/.]*$", code) THEN
Code = "*" & code & "*"
Else
CODE = "* 51windows.net *"
Errstr = "
END IF
END IF
Ocode = CODE
Code = LCase (Code)
%>