资源描述:
《code彩色可变位数asp验证码类代码》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、<%ClassCAMXAM_COM_RndCodeBmpPrivateTextDataLib,TextData,BmpData,BmpHead,BmpWidth,BmpHeight,BmpSize,TextDataLength,SessionStringPublicSessionName,TextLength,BackColor,TextColor,YawpColor,YawpCountPrivateSubClass_Initialize()EndSubPrivateSubClass_Terminate()EndSubPublicFunctio
2、nSetTextInfo(TextString)ReDimTextDataLib(0)TextDataLib(0)=TextStringEndFunctionPublicFunctionAddTextData(TextDataString)TextDataLength=UBound(TextDataLib)+1ReDimPreserveTextDataLib(TextDataLength)TextDataLib(TextDataLength)=TextDataStringEndFunctionPrivateFunctionGetbinary(I
3、ntNumber)DimIntBin0,IntBin1,IntBin2,IntBin0_,IntBin1_,IntBin2_IntBin0=Int(IntNumber/16777216)IntBin0_=IntNumberMod16777216IntBin1=Int(IntBin0_/65536)IntBin1_=IntBin0_Mod65536IntBin2=Int(IntBin1_/256)IntBin2_=IntBin1_Mod256Getbinary=ChrB(IntBin2_)&ChrB(IntBin2)&ChrB(IntBin1)&
4、ChrB(IntBin0)EndFunctionPrivateFunctionGetColadRstring(ColadRstring)DimColorArray,CALengthColorArray=Split(ColadRstring,",")CALength=UBound(ColorArray)GetColadRstring=ColorArray(GetRnd(0,CALength))EndFunctionPrivateFunctionGetRnd(LowNumber,UpNumber)RandomizeTimerGetRnd=Int((
5、UpNumber-LowNumber+1)*Rnd+LowNumber)EndFunctionPrivateFunctionFileHeader()Response.Expires=-1Response.AddHeader"Pragma","no-cache"Response.AddHeader"cache-ctrol","no-cache"Response.ContentType="Image/BMP"EndFunctionPrivateFunctionSetBmpHead(BmpSize,Width,Height)BmpHead=ChrB(
6、66)&ChrB(77)BmpHead=BmpHead&Getbinary(BmpSize+54)BmpHead=BmpHead&Getbinary(0)BmpHead=BmpHead&Getbinary(54)BmpHead=BmpHead&Getbinary(40)BmpHead=BmpHead&Getbinary(Width)BmpHead=BmpHead&Getbinary(Height)BmpHead=BmpHead&ChrB(1)&ChrB(0)BmpHead=BmpHead&ChrB(24)&ChrB(0)BmpHead=BmpH
7、ead&Getbinary(0)BmpHead=BmpHead&Getbinary(BmpSize)BmpHead=BmpHead&Getbinary(65536)BmpHead=BmpHead&Getbinary(65536)BmpHead=BmpHead&Getbinary(16777216)BmpHead=BmpHead&Getbinary(16777216)EndFunctionPrivateFunctionGetRndTextData()ReDimTextData(TextLength-1)DimITextForIText=0ToTe
8、xtLength-1Step+1TextData(IText)=GetColadRstring(BackColor)&""&GetColadRstri