我要投稿
  • 您当前的位置:57365.com -> 技术教程 -> 网站建设教程 -> 源码精华 -> 教程内容
  • [ 收藏本页教程 ]
  • VerifyCode(asp),gif验证码生成技术源码精华教程

    教程作者:佚名    教程来源:不详   教程栏目:源码精华    收藏本页
    <%
    '--------------------------------------
    'Fly38.com - VerifyCode Class
    ' gif 验证码生成类
    ' 原作者:NetRube
    '--------------------------------------
    Class Fly38_VerifyCode
    Public GlobalColorTable(), LocalColorTable()
    Public TransparentColorIndex, UseTransparency
    Public GIF89a
    Public Comment

    Private FGroundColorIndex, BGroundColorIndex
    Private Image
    Private GlobalColorTableSize, GlobalColorTableFlag, LocalColorTableSize, LocalColorTableFlag
    Private Width_, Height_
    Private LeftPosition, TopPosition
    Private Bits, ColorResolution, CodeSize
    Private PixelAspectRatio
    Private SortFlag, InterlaceFlag
    Private Seperator, GraphicControl, EndOfImage
    Private Reserved

    Private Font
    Private Letter(19)

    Private Sub Class_Initialize()
    Image = ""

    GIF89a = False

    ReDim GlobalColorTable(256)
    GlobalColorTableSize = 7
    GlobalColorTableFlag = True

    GlobalColorTable(2) = RGB(255, 0, 0)
    GlobalColorTable(3) = RGB(0, 255, 0)
    GlobalColorTable(4) = RGB(0, 0, 255)
    GlobalColorTable(5) = RGB(255, 255, 0)
    GlobalColorTable(6) = RGB(0, 255, 255)
    GlobalColorTable(7) = RGB(255, 0, 255)

    ReDim LocalColorTable(0)
    LocalColorTableSize = 0
    LocalColorTableFlag = False

    ColorResolution = 7
    Bits = 7
    CodeSize = 7

    BGroundColorIndex = 0
    FGroundColorIndex = 1
    TransparentColorIndex = 0
    UseTransparency = False

    LeftPosition = 0
    TopPosition = 0
    Width_ = 20
    Height_ = 20

    Clear

    PixelAspectRatio = 0
    SortFlag = False
    InterlaceFlag = False
    Seperator = Asc(",")
    GraphicControl = Asc("!")
    EndOfImage = Asc(";")

    Comment = ""

    Reserved = 0

    Set Font = Server.CreateObject("Scripting.Dictionary")

    Letter(0) = "00000000000000"
    Letter(1) = "00001111100000"
    Letter(2) = "00011111110000"
    Letter(3) = "00111000111000"
    Letter(4) = "00110000011100"
    Letter(5) = "01110000001100"
    Letter(6) = "01100000001110"
    Letter(7) = "01100000001110"
    Letter(8) = "11100000001110"
    Letter(9) = "11000000001110"
    Letter(10) = "11000000001110"
    Letter(11) = "11100000001110"
    Letter(12) = "11100000001100"
    Letter(13) = "11100000001100"
    Letter(14) = "01100000001100"
    Letter(15) = "01110000011100"
    Letter(15) = "00111000011000"
    Letter(16) = "00011111110000"
    Letter(17) = "00001111100000"
    Letter(18) = "00000000000000"
    Font.Add "0", Letter

    Letter(0) = "00000000000000"
    Letter(1) = "00000001110000"
    Letter(2) = "00000001110000"
    Letter(3) = "00000011100000"
    Letter(4) = "00000011000000"
    Letter(5) = "00000011000000"
    Letter(6) = "00000011000000"
    Letter(7) = "00000111000000"
    Letter(8) = "00000111000000"
    Letter(9) = "00000111000000"
    Letter(10) = "00000110000000"
    Letter(11) = "00000110000000"
    Letter(12) = "00000110000000"
    Letter(13) = "00000110000000"
    Letter(14) = "00000110000000"
    Letter(15) = "00000110000000"
    Letter(15) = "00000110000000"
    Letter(16) = "00000110000000"
    Letter(17) = "00000010000000"
    Letter(18) = "00000000000000"
    Font.Add "1", Letter

    Letter(0) = "00000000000000"
    Letter(1) = "00001111110000"
    Letter(2) = "00011111111000"
    Letter(3) = "00111000011100"
    Letter(4) = "01110000011100"
    Letter(5) = "01110000011000"
    Letter(6) = "01100000011000"
    Letter(7) = "00000000111000"
    Letter(8) = "00000001110000"
    Letter(9) = "00000001110000"
    Letter(10) = "00000011000000"
    Letter(11) = "00000111000000"
    Letter(12) = "00001110000000"
    Letter(13) = "00011000000000"
    Letter(14) = "00011000000000"
    Letter(15) = "00110000011100"
    Letter(16) = "01101111111100"
    Letter(17) = "01111111111110"
    Letter(18) = "01111100000000"
    Letter(19) = "00000000000000"
    Font.Add "2", Letter

    Letter(0) = "00000000000000"
    Letter(1) = "00001111111000"
    Letter(2) = "00111111111000"
    Letter(3) = "01110000111100"
    Letter(4) = "01100000011000"
    Letter(5) = "01000000111000"
    Letter(6) = "00000000111000"
    Letter(7) = "00000001110000"
    Letter(8) = "00000011000000"
    Letter(9) = "00000111110000"
    Letter(10) = "00000100111000"
    Letter(11) = "00000000011100"
    Letter(12) = "00000000011100"
    Letter(13) = "00000000011100"
    Letter(14) = "00000000011100"
    Letter(15) = "00000000011000"
    Letter(16) = "11100000111000"
    Letter(17) = "11111111110000"
    Letter(18) = "01111111100000"
    Letter(19) = "00000000000000"
    Font.Add "3", Letter

    Letter(0) = "00000000000000"
    Letter(1) = &qu
    我要投稿   -   广告合作   -   关于本站   -   友情连接   -   网站地图   -   联系我们   -   版权声明   -   设为首页   -   加入收藏   -   网站留言
    Copyright © 2009 - 20012 www.www.hxswjs.com All Rights Reserved.57365.com 版权所有