??xml version="1.0" encoding="utf-8" standalone="yes"?>国产精品午夜电影,欧美在线日韩,蜜桃精品视频在线观看http://www.aygfsteel.com/hayun/category/17145.htmlwelcome to my online log ! open java new world! Taste java charm........zh-cnTue, 08 Jan 2008 11:23:32 GMTTue, 08 Jan 2008 11:23:32 GMT60asp 动态生成验证码http://www.aygfsteel.com/hayun/articles/createCode.html?/dc:creator>?/author>Mon, 07 Jan 2008 14:44:00 GMThttp://www.aygfsteel.com/hayun/articles/createCode.html<%
Const nMaxSaturation = 100   ' 最大色彩饱和度
Const nBlankNoisyDotOdds = 0.2  ' I白处噪点率
Const nColorNoisyDotOdds = 0.1 ' 有色处噪点率
Const nCharCount = 4      ' 产生的字W个?br /> Const nPixelWidth = 20     ' 单个字符位图的宽?br /> Const nPixelHeight = 20       ' 单个字符位图的高?br /> Const nColorHue = 220      ' 昄验证码的色调(-1表示随机色调, -2表示灰度色调)
Const nAngleRandom = 10         ' 角度随机?br /> Const nLengthRandom = 10        ' 长度随机?癑ֈ?
Const cCharSet = "0123456789"
                                ' 构成验证码的字符?br />                                 ' 如果扩充了下边的字母矢量库,则可以相应扩充这个字W集

Dim Buf(), DigtalStr
Dim Lines(), LineCount
Dim CursorX, CursorY, DirX, DirY

Randomize
Call CreaalidCode("GetCode")

Sub CDGen_Reset()
 ' 复位矢量W和环境变量
 LineCount = 0
 CursorX = 0
 CursorY = 0
 ' 初始的光W方向是垂直向下
 DirX = 0
 DirY = 1
End Sub

Sub CDGen_Clear()
 ' 清空位图阵列
 Dim i, j
 ReDim Buf(nPixelHeight - 1, nCharCount * nPixelWidth - 1)

 For j = 0 To nPixelHeight - 1
  For i = 0 To nCharCount * nPixelWidth - 1
   Buf(j, i) = 0
  Next
 Next
End Sub

Sub CDGen_PSet(X, Y)
 ' 在位N列上ȝ
 Buf(Y, X) = 1
End Sub

Sub CDGen_Line(X1, Y1, X2, Y2)
 ' 在位N列上ȝ
 Dim DX, DY, DeltaT, i
 
 DX = X2 - X1
 DY = Y2 - Y1
 If Abs(DX) > Abs(DY) Then DeltaT = Abs(DX) Else DeltaT = Abs(DY)
 For i = 0 To DeltaT
  CDGen_PSet X1 + DX * i / DeltaT, Y1 + DY * i / DeltaT
 Next
End Sub

Sub CDGen_FowardDraw(nLength)
 ' 按当前光W方向绘制指定长度ƈUd光笔Q正数表CZ左向?从上向下l制Q负数表CZ叛_?从下向上l制
 nLength = Sgn(nLength) * Abs(nLength) * (1 - nLengthRandom / 100 + Rnd * nLenghtRandom * 2 / 100)
 ReDim Preserve Lines(3, LineCount)
 Lines(0, LineCount) = CursorX
 Lines(1, LineCount) = CursorY
 CursorX = CursorX + DirX * nLength
 CursorY = CursorY + DirY * nLength
 Lines(2, LineCount) = CursorX
 Lines(3, LineCount) = CursorY
 LineCount = LineCount + 1
End Sub

Sub CDGen_SetDirection(nAngle)
 ' 按指定角度设定画W方? 正数表示相对当前方向时针改变方向,负数表示相对当前方向逆时针改变方?br />  Dim DX, DY
 
 nAngle = Sgn(nAngle) * (Abs(nAngle) - nAngleRandom + Rnd * nAngleRandom * 2) / 180 * 3.1415926
 DX = DirX
 DY = DirY
 DirX = DX * Cos(nAngle) - DY * Sin(nAngle)
 DirY = DX * Sin(nAngle) + DY * Cos(nAngle)
End Sub

Sub CDGen_MoveToMiddle(nActionIndex, nPercent)
 ' 画W光标移动到指定动作的中间点上,nPercentZ间位|的癑ֈ?br />  Dim DeltaX, DeltaY
 
 DeltaX = Lines(2, nActionIndex) - Lines(0, nActionIndex)
 DeltaY = Lines(3, nActionIndex) - Lines(1, nActionIndex)
 CursorX = Lines(0, nActionIndex) + Sgn(DeltaX) * Abs(DeltaX) * nPercent / 100
 CursorY = Lines(1, nActionIndex) + Sgn(DeltaY) * Abs(DeltaY) * nPercent / 100
End Sub

Sub CDGen_MoveCursor(nActionIndex)
 ' 画W光标移动到指定动作的v始点?br />  CursorX = Lines(0, nActionIndex)
 CursorY = Lines(1, nActionIndex)
End Sub

Sub CDGen_Close(nActionIndex)
 ' 当前光W位|与指定动作的v始点闭合q移动光W?br />  ReDim Preserve Lines(3, LineCount)
 Lines(0, LineCount) = CursorX
 Lines(1, LineCount) = CursorY
 CursorX = Lines(0, nActionIndex)
 CursorY = Lines(1, nActionIndex)
 Lines(2, LineCount) = CursorX
 Lines(3, LineCount) = CursorY
 LineCount = LineCount + 1
End Sub

Sub CDGen_CloseToMiddle(nActionIndex, nPercent)
 ' 当前光W位|与指定动作的中间点闭合q移动光W,nPercentZ间位|的癑ֈ?br />  Dim DeltaX, DeltaY
 
 ReDim Preserve Lines(3, LineCount)
 Lines(0, LineCount) = CursorX
 Lines(1, LineCount) = CursorY
 DeltaX = Lines(2, nActionIndex) - Lines(0, nActionIndex)
 DeltaY = Lines(3, nActionIndex) - Lines(1, nActionIndex)
 CursorX = Lines(0, nActionIndex) + Sgn(DeltaX) * Abs(DeltaX) * nPercent / 100
 CursorY = Lines(1, nActionIndex) + Sgn(DeltaY) * Abs(DeltaY) * nPercent / 100
 Lines(2, LineCount) = CursorX
 Lines(3, LineCount) = CursorY
 LineCount = LineCount + 1
End Sub

Sub CDGen_Flush(X0, Y0)
 ' 按照当前的画W动作序列绘制位囄?br />  Dim MaxX, MinX, MaxY, MinY
 Dim DeltaX, DeltaY, StepX, StepY, OffsetX, OffsetY
 Dim i

 MaxX = MinX = MaxY = MinY = 0
 For i = 0 To LineCount - 1
  If MaxX < Lines(0, i) Then MaxX = Lines(0, i)
  If MaxX < Lines(2, i) Then MaxX = Lines(2, i)
  If MinX > Lines(0, i) Then MinX = Lines(0, i)
  If MinX > Lines(2, i) Then MinX = Lines(2, i)
  If MaxY < Lines(1, i) Then MaxY = Lines(1, i)
  If MaxY < Lines(3, i) Then MaxY = Lines(3, i)
  If MinY > Lines(1, i) Then MinY = Lines(1, i)
  If MinY > Lines(3, i) Then MinY = Lines(3, i)
 Next
 DeltaX = MaxX - MinX
 DeltaY = MaxY - MinY
 If DeltaX = 0 Then DeltaX = 1
 If DeltaY = 0 Then DeltaY = 1
 MaxX = MinX
 MaxY = MinY
 If DeltaX > DeltaY Then
  StepX = (nPixelWidth - 2) / DeltaX
  StepY = (nPixelHeight - 2) / DeltaX
  OffsetX = 0
  OffsetY = (DeltaX - DeltaY) / 2
 Else
  StepX = (nPixelWidth - 2) / DeltaY
  StepY = (nPixelHeight - 2) / DeltaY
  OffsetX = (DeltaY - DeltaX) / 2
  OffsetY = 0
 End If
 For i = 0 To LineCount - 1
  Lines(0, i) = Round((Lines(0, i) - MaxX + OffsetX) * StepX, 0)
  If Lines(0, i) < 0 Then Lines(0, i) = 0
  If Lines(0, i) >= nPixelWidth - 2 Then Lines(0, i) = nPixelWidth - 3
  Lines(1, i) = Round((Lines(1, i) - MaxY + OffsetY) * StepY, 0)
  If Lines(1, i) < 0 Then Lines(1, i) = 0
  If Lines(1, i) >= nPixelHeight - 2 Then Lines(1, i) = nPixelHeight - 3
  Lines(2, i) = Round((Lines(2, i) - MinX + OffsetX) * StepX, 0)
  If Lines(2, i) < 0 Then Lines(2, i) = 0
  If Lines(2, i) >= nPixelWidth - 2 Then Lines(2, i) = nPixelWidth - 3
  Lines(3, i) = Round((Lines(3, i) - MinY + OffsetY) * StepY, 0)
  If Lines(3, i) < 0 Then Lines(3, i) = 0
  If Lines(3, i) >= nPixelHeight - 2 Then Lines(3, i) = nPixelHeight - 3
  CDGen_Line Lines(0, i) + X0 + 1, Lines(1, i) + Y0 + 1, Lines(2, i) + X0 + 1, Lines(3, i) + Y0 + 1
 Next
End Sub

Sub CDGen_Char(cChar, X0, Y0)
 ' 在指定坐标处生成指定字符的位N?br />  CDGen_Reset
 Select Case cChar
 Case "0"
  CDGen_SetDirection -60                            ' 逆时?0?相对于垂直线)
  CDGen_FowardDraw -0.7                             ' 反方向绘?.7个单?br />   CDGen_SetDirection -60                            ' 逆时?0?br />   CDGen_FowardDraw -0.7                             ' 反方向绘?.7个单?br />   CDGen_SetDirection 120                            ' 时?20?br />   CDGen_FowardDraw 1.5                              ' l制1.5个单?br />   CDGen_SetDirection -60                            ' 逆时?0?br />   CDGen_FowardDraw 0.7                              ' l制0.7个单?br />   CDGen_SetDirection -60                            ' 时?20?br />   CDGen_FowardDraw 0.7                              ' l制0.7个单?br />   CDGen_Close 0                                     ' 闭当前W与W?W?0开?
 Case "1"
  CDGen_SetDirection -90                            ' 逆时?0?相对于垂直线)
  CDGen_FowardDraw 0.5                              ' l制0.5个单?br />   CDGen_MoveToMiddle 0, 50                          ' Udȝ的位|到W?W?0开??0%?br />   CDGen_SetDirection 90                             ' 逆时?0?br />   CDGen_FowardDraw -1.4                             ' 反方向绘?.4个单?br />   CDGen_SetDirection 30                             ' 逆时?0?br />   CDGen_FowardDraw 0.4                              ' l制0.4个单?br />  Case "2"
  CDGen_SetDirection 45                             ' 时?5?相对于垂直线)
  CDGen_FowardDraw -0.7                             ' 反方向绘?.7个单?br />   CDGen_SetDirection -120                           ' 逆时?20?br />   CDGen_FowardDraw 0.4                              ' l制0.4个单?br />   CDGen_SetDirection 60                             ' 时?0?br />   CDGen_FowardDraw 0.6                              ' l制0.6个单?br />   CDGen_SetDirection 60                             ' 时?0?br />   CDGen_FowardDraw 1.6                              ' l制1.6个单?br />   CDGen_SetDirection -135                           ' 逆时?35?br />   CDGen_FowardDraw 1.0                              ' l制1.0个单?br />  Case "3"
  CDGen_SetDirection -90                            ' 逆时?0?相对于垂直线)
  CDGen_FowardDraw 0.8                              ' l制0.8个单?br />   CDGen_SetDirection 135                            ' 时?35?br />   CDGen_FowardDraw 0.8                              ' l制0.8个单?br />   CDGen_SetDirection -120                           ' 逆时?20?br />   CDGen_FowardDraw 0.6                              ' l制0.6个单?br />   CDGen_SetDirection 80                             ' 时?0?br />   CDGen_FowardDraw 0.5                              ' l制0.5个单?br />   CDGen_SetDirection 60                             ' 时?0?br />   CDGen_FowardDraw 0.5                              ' l制0.5个单?br />   CDGen_SetDirection 60                             ' 时?0?br />   CDGen_FowardDraw 0.5                              ' l制0.5个单?br />  Case "4"
  CDGen_SetDirection 20                             ' 时?0?相对于垂直线)
  CDGen_FowardDraw 0.8                              ' l制0.8个单?br />   CDGen_SetDirection -110                           ' 逆时?10?br />   CDGen_FowardDraw 1.2                              ' l制1.2个单?br />   CDGen_MoveToMiddle 1, 60                          ' Udȝ的位|到W?W?0开??0%?br />   CDGen_SetDirection 90                             ' 时?0?br />   CDGen_FowardDraw 0.7                              ' l制0.7个单?br />   CDGen_MoveCursor 2                                ' Udȝ到第2W?0开?的开始处
  CDGen_FowardDraw -1.5                             ' 反方向绘?.5个单?br />  Case "5"
  CDGen_SetDirection 90                             ' 时?0?相对于垂直线)
  CDGen_FowardDraw 1.0                              ' l制1.0个单?br />   CDGen_SetDirection -90                            ' 逆时?0?br />   CDGen_FowardDraw 0.8                              ' l制0.8个单?br />   CDGen_SetDirection -90                            ' 逆时?0?br />   CDGen_FowardDraw 0.8                              ' l制0.8个单?br />   CDGen_SetDirection 30                             ' 时?0?br />   CDGen_FowardDraw 0.4                              ' l制0.4个单?br />   CDGen_SetDirection 60                             ' 时?0?br />   CDGen_FowardDraw 0.4                              ' l制0.4个单?br />   CDGen_SetDirection 30                             ' 时?0?br />   CDGen_FowardDraw 0.5                              ' l制0.5个单?br />   CDGen_SetDirection 60                             ' 时?0?br />   CDGen_FowardDraw 0.8                              ' l制0.8个单?br />  Case "6"
  CDGen_SetDirection -60                            ' 逆时?0?相对于垂直线)
  CDGen_FowardDraw -0.7                             ' 反方向绘?.7个单?br />   CDGen_SetDirection -60                            ' 逆时?0?br />   CDGen_FowardDraw -0.7                             ' 反方向绘?.7个单?br />   CDGen_SetDirection 120                            ' 时?20?br />   CDGen_FowardDraw 1.5                              ' l制1.5个单?br />   CDGen_SetDirection 120                            ' 时?20?br />   CDGen_FowardDraw -0.7                             ' 反方向绘?.7个单?br />   CDGen_SetDirection 120                            ' 时?20?br />   CDGen_FowardDraw 0.7                              ' l制0.7个单?br />   CDGen_SetDirection 120                            ' 时?20?br />   CDGen_FowardDraw -0.7                             ' 反方向绘?.7个单?br />   CDGen_SetDirection 120                            ' 时?20?br />   CDGen_FowardDraw 0.5                              ' l制0.5个单?br />   CDGen_CloseToMiddle 2, 50                         ' 当前画W位|与W?W?0开??0%处封?br />  Case "7"
  CDGen_SetDirection 180                            ' 时?80?相对于垂直线)
  CDGen_FowardDraw 0.3                              ' l制0.3个单?br />   CDGen_SetDirection 90                             ' 时?0?br />   CDGen_FowardDraw 0.9                              ' l制0.9个单?br />   CDGen_SetDirection 120                            ' 时?20?br />   CDGen_FowardDraw 1.3                              ' l制1.3个单?br />  Case "8"
  CDGen_SetDirection -60                            ' 逆时?0?相对于垂直线)
  CDGen_FowardDraw -0.8                             ' 反方向绘?.8个单?br />   CDGen_SetDirection -60                            ' 逆时?0?br />   CDGen_FowardDraw -0.8                             ' 反方向绘?.8个单?br />   CDGen_SetDirection 120                            ' 时?20?br />   CDGen_FowardDraw 0.8                              ' l制0.8个单?br />   CDGen_SetDirection 110                            ' 时?10?br />   CDGen_FowardDraw -1.5                             ' 反方向绘?.5个单?br />   CDGen_SetDirection -110                           ' 逆时?10?br />   CDGen_FowardDraw 0.9                              ' l制0.9个单?br />   CDGen_SetDirection 60                             ' 时?0?br />   CDGen_FowardDraw 0.8                              ' l制0.8个单?br />   CDGen_SetDirection 60                             ' 时?0?br />   CDGen_FowardDraw 0.8                              ' l制0.8个单?br />   CDGen_SetDirection 60                             ' 时?0?br />   CDGen_FowardDraw 0.9                              ' l制0.9个单?br />   CDGen_SetDirection 70                             ' 时?0?br />   CDGen_FowardDraw 1.5                             ' l制1.5个单?br />   CDGen_Close 0                                     ' 闭当前W与W?W?0开?
 Case "9"
  CDGen_SetDirection 120                            ' 逆时?0?相对于垂直线)
  CDGen_FowardDraw -0.7                             ' 反方向绘?.7个单?br />   CDGen_SetDirection -60                            ' 逆时?0?br />   CDGen_FowardDraw -0.7                             ' 反方向绘?.7个单?br />   CDGen_SetDirection -60                            ' 时?20?br />   CDGen_FowardDraw -1.5                              ' l制1.5个单?br />   CDGen_SetDirection -60                            ' 时?20?br />   CDGen_FowardDraw -0.7                             ' 反方向绘?.7个单?br />   CDGen_SetDirection -60                            ' 时?20?br />   CDGen_FowardDraw -0.7                              ' l制0.7个单?br />   CDGen_SetDirection 120                            ' 时?20?br />   CDGen_FowardDraw 0.7                             ' 反方向绘?.7个单?br />   CDGen_SetDirection -60                            ' 时?20?br />   CDGen_FowardDraw 0.5                              ' l制0.5个单?br />   CDGen_CloseToMiddle 2, 50                         ' 当前画W位|与W?W?0开??0%处封?br />  ' 以下为字母的矢量动作Q有兴趣的可以l?br />  Case "A"
  CDGen_SetDirection -(Rnd * 20 + 150)              ' 逆时?50-170?相对于垂直线)
  CDGen_FowardDraw Rnd * 0.2 + 1.1                  ' l制1.1-1.3个单?br />   CDGen_SetDirection Rnd * 20 + 140                 ' 时?40-160?br />   CDGen_FowardDraw Rnd * 0.2 + 1.1                  ' l制1.1-1.3个单?br />   CDGen_MoveToMiddle 0, 30                          ' Udȝ的位|到W?W?0开??0%?br />   CDGen_CloseToMiddle 1, 70                         ' 当前画W位|与W?W?0开??0%处封?br />  Case "B"
  CDGen_SetDirection -(Rnd * 20 + 50)               ' 逆时?0-70?相对于垂直线)
  CDGen_FowardDraw Rnd * 0.4 + 0.8                  ' l制0.8-1.2个单?br />   CDGen_SetDirection Rnd * 20 + 110                 ' 时?10-130?br />   CDGen_FowardDraw Rnd * 0.2 + 0.6                  ' l制0.6-0.8个单?br />   CDGen_SetDirection -(Rnd * 20 + 110)              ' 逆时?10-130?br />   CDGen_FowardDraw Rnd * 0.2 + 0.6                  ' l制0.6-0.8个单?br />   CDGen_SetDirection Rnd * 20 + 110                 ' 时?10-130?br />   CDGen_FowardDraw Rnd * 0.4 + 0.8                  ' l制0.8-1.2个单?br />   CDGen_Close 0                                     ' 闭当前W与W?W?0开?
 Case "C"
  CDGen_SetDirection -60                            ' 逆时?0?相对于垂直线)
  CDGen_FowardDraw -0.7                             ' 反方向绘?.7个单?br />   CDGen_SetDirection -60                            ' 逆时?0?br />   CDGen_FowardDraw -0.7                             ' 反方向绘?.7个单?br />   CDGen_SetDirection 120                            ' 时?20?br />   CDGen_FowardDraw 1.5                              ' l制1.5个单?br />   CDGen_SetDirection 120                            ' 时?20?br />   CDGen_FowardDraw -0.7                             ' 反方向绘?.7个单?br />   CDGen_SetDirection 120                            ' 时?20?br />   CDGen_FowardDraw 0.7                              ' l制0.7个单?br />  End Select
 CDGen_Flush X0, Y0
End Sub

Sub CDGen_Blur()
 ' 对生的位图q行柔化处理
 Dim i, j
 
 For j = 1 To nPixelHeight - 2
  For i = 1 To nCharCount * nPixelWidth - 2
   If Buf(j, i) = 0 Then
    If ((Buf(j, i - 1) Or Buf(j + 1, i)) And 1) <> 0 Then
     ' 如果当前ҎI白点,且上下左叛_个点中有一个点是有色点Q则该点做柔化处?br />      Buf(j, i) = 2
    End If
   End If
  Next
 Next
End Sub

Sub CDGen_NoisyDot()
 ' 对生的位图q行噪点处理
 Dim i, j, NoisyDot, CurDot
 
 For j = 0 To nPixelHeight - 1
  For i = 0 To nCharCount * nPixelWidth - 1
   If Buf(j, i) <> 0 Then
    NoisyDot = Int(Rnd * Rnd * nMaxSaturation)
    Select Case nColorNoisyDotOdds
    Case 0
     CurDot = nMaxSaturation
    Case 1
     CurDot = 0
    Case Else
     CurDot = NoisyDot
    End Select
    If Rnd < nColorNoisyDotOdds Then Buf(j, i) = CurDot Else Buf(j, i) = nMaxSaturation
   Else
    NoisyDot = Int(Rnd * nMaxSaturation)
    Select Case nBlankNoisyDotOdds
    Case 0
     CurDot = 0
    Case 1
     CurDot = nMaxSaturation
    Case Else
     CurDot = NoisyDot
    End Select
    If Rnd < nBlankNoisyDotOdds Then Buf(j, i) = CurDot Else Buf(j, i) = 0
   End If
  Next
 Next
End Sub

Sub CDGen()
 ' 生成位图阵列
 Dim i, Ch
 
 DigtalStr = ""
 CDGen_Clear
 For i = 0 To nCharCount - 1
  Ch = Mid(cCharSet, Int(Rnd * Len(cCharSet)) + 1, 1)
  DigtalStr = DigtalStr + Ch
  CDGen_Char Ch, i * nPixelWidth, 0
 Next
 CDGen_Blur
 CDGen_NoisyDot
End Sub

Function HSBToRGB(vH, vS, vB)
 ' 颜色值由HSB转换为RGB
 Dim aRGB(3), RGB1st, RGB2nd, RGB3rd
 Dim nH, nS, nB
 Dim lH, nF, nP, nQ, nT

 vH = (vH Mod 360)
 If vS > 100 Then
  vS = 100
 ElseIf vS < 0 Then
  vS = 0
 End If
 If vB > 100 Then
  vB = 100
 ElseIf vB < 0 Then
  vB = 0
 End If
 If vS > 0 Then
  nH = vH / 60
  nS = vS / 100
  nB = vB / 100
  lH = Int(nH)
  nF = nH - lH
  nP = nB * (1 - nS)
  nQ = nB * (1 - nS * nF)
  nT = nB * (1 - nS * (1 - nF))
  Select Case lH
  Case 0
   aRGB(0) = nB * 255
   aRGB(1) = nT * 255
   aRGB(2) = nP * 255
  Case 1
   aRGB(0) = nQ * 255
   aRGB(1) = nB * 255
   aRGB(2) = nP * 255
  Case 2
   aRGB(0) = nP * 255
   aRGB(1) = nB * 255  
   aRGB(2) = nT * 255
  Case 3
   aRGB(0) = nP * 255
   aRGB(1) = nQ * 255
   aRGB(2) = nB * 255
  Case 4
   aRGB(0) = nT * 255
   aRGB(1) = nP * 255
   aRGB(2) = nB * 255
  Case 5
   aRGB(0) = nB * 255
   aRGB(1) = nP * 255
   aRGB(2) = nQ * 255
  End Select   
 Else
  aRGB(0) = (vB * 255) / 100
  aRGB(1) = aRGB(0)
  aRGB(2) = aRGB(0)
 End If
 HSBToRGB = ChrB(Round(aRGB(2), 0)) & ChrB(Round(aRGB(1), 0)) & ChrB(Round(aRGB(0), 0))
End Function

Sub CreaalidCode(pSN)
 Dim i, j, CurColorHue
 
 ' 止~存
 Response.Expires = -9999
 Response.AddHeader "pragma", "no-cache"
 Response.AddHeader "cache-ctrol", "no-cache"
 Response.ContentType = "image/bmp"
 
 Call CDGen
 Session(pSN) = DigtalStr '记录入Session

 Dim PicWidth, PicHeight, FileSize, PicDataSize
 PicWidth = nCharCount * nPixelWidth
 PicHeight = nPixelHeight
 PicDataSize = PicWidth * PicHeight * 3
 FileSize = PicDataSize + 54
 
 ' 输出BMP文g信息?br />  Response.BinaryWrite ChrB(66) & ChrB(77) & _
  ChrB(FileSize Mod 256) & ChrB((FileSize \ 256) Mod 256) & ChrB((FileSize \ 256 \ 256) Mod 256) & ChrB(FileSize \ 256 \ 256 \ 256) & _
  ChrB(0) & ChrB(0) & ChrB(0) & ChrB(0) & _
  ChrB(54) & ChrB(0) & ChrB(0) & ChrB(0)

 ' 输出BMP位图信息?br />  Response.BinaryWrite ChrB(40) & ChrB(0) & ChrB(0) & ChrB(0) & _
  ChrB(PicWidth Mod 256) & ChrB((PicWidth \ 256) Mod 256) & ChrB((PicWidth \ 256 \ 256) Mod 256) & ChrB(PicWidth \ 256 \ 256 \ 256) & _
  ChrB(PicHeight Mod 256) & ChrB((PicHeight \ 256) Mod 256) & ChrB((PicHeight \ 256 \ 256) Mod 256) & ChrB(PicHeight \ 256 \ 256 \ 256) & _
  ChrB(1) & ChrB(0) & _
  ChrB(24) & ChrB(0) & _
  ChrB(0) & ChrB(0) & ChrB(0) & ChrB(0) & _
  ChrB(PicDataSize Mod 256) & ChrB((PicDataSize \ 256) Mod 256) & ChrB((PicDataSize \ 256 \ 256) Mod 256) & ChrB(PicDataSize \ 256 \ 256 \ 256) & _
  ChrB(18) & ChrB(11) & ChrB(0) & ChrB(0) & _
  ChrB(18) & ChrB(11) & ChrB(0) & ChrB(0) & _
  ChrB(0) & ChrB(0) & ChrB(0) & ChrB(0) & _
  ChrB(0) & ChrB(0) & ChrB(0) & ChrB(0)

 ' 逐点输出位图阵列
 If nColorHue = -1 Then
  CurColorHue = Int(Rnd * 360)
 ElseIf nColorHue = -2 Then
  CurColorHue = 0
 Else
  CurColorHue = nColorHue
 End If
 For j = 0 To nPixelHeight - 1
  For i = 0 To Len(DigtalStr) * nPixelWidth - 1
   If nColorHue = -2 Then
    Response.BinaryWrite HSBToRGB(CurColorHue, 0, 100 - Buf(nPixelHeight - 1 - j, i))
   Else
    Response.BinaryWrite HSBToRGB(CurColorHue, Buf(nPixelHeight - 1 - j, i), 100)
   End If
  Next
 Next
End Sub
%>



]]>
asp.net 手写代码实现http://www.aygfsteel.com/hayun/articles/dotnet1.html?/dc:creator>?/author>Mon, 07 May 2007 14:31:00 GMThttp://www.aygfsteel.com/hayun/articles/dotnet1.htmlhttp://www.aygfsteel.com/hayun/comments/115769.htmlhttp://www.aygfsteel.com/hayun/articles/dotnet1.html#Feedback0http://www.aygfsteel.com/hayun/comments/commentRss/115769.htmlhttp://www.aygfsteel.com/hayun/services/trackbacks/115769.html<%@ Page Language="C#" ContentType="text/html" ResponseEncoding="gb2312" EnableEventValidation="false"%>
<%@ import Namespace = "System.Data"%>
<%@ import Namespace = "System.Data.OleDb"%>

<style type="text/css">
td{ font-size:12px}
</style>
<script runat="server" language="c#">
 
 string strSQL = "select * from product";
 OleDbConnection mycon;
 OleDbCommand mycmd;
 public void page_load(Object sender,EventArgs e){
 if(!IsPostBack){
 string strDSN = "Provider=Microsoft.Jet.OleDb.4.0;Data Source="+Server.MapPath("data.mdb");
 try{
  mycon = new OleDbConnection(strDSN);
  mycmd = new OleDbCommand(strSQL,mycon);
 mycon.Open();
 datagrid1.DataSource = mycmd.ExecuteReader();
 datagrid1.DataBind();
 }catch(OleDbException f){
  Response.Write("数据库连接出?");
 }
 }
 }
 public void DataGrid_DeleteItem(Object sender,DataGridCommandEventArgs e){
 string delCmd = "delete from product where pid=@pid";
 mycon = new OleDbConnection("Provider=Microsoft.Jet.OleDb.4.0;Data Source="+Server.MapPath("data.mdb"));
 mycmd = new OleDbCommand(delCmd,mycon);
 mycmd.Parameters.Add("@pid",datagrid1.DataKeys[e.Item.ItemIndex]);
 mycon.Open();
 mycmd.ExecuteNonQuery();
 Response.Write("<script type='text/javascript'> alert('删除成功完成!'); window.location.href='ConnAcc2.aspx'; </s" + "cript>");
 //Response.Write(datagrid1.DataKeys[e.Item.ItemIndex]);
 
 }
 
 public void DataGrid_EditorItem(Object sender,DataGridCommandEventArgs e){
 Response.Write(datagrid1.DataKeys[e.Item.ItemIndex]);
 }
</script>

<form runat="server">
<asp:DataGrid ID="datagrid1" runat="server" ShowFooter="false" AutoGenerateColumns="false" OnDeleteCommand="DataGrid_DeleteItem" DataKeyField="pid"
 OnEditCommand="DataGrid_EditorItem">
<columns>
<asp:BoundColumn DataField="pname" HeaderText="产品名称"></asp:BoundColumn>
<asp:ButtonColumn CommandName="delete" Text="删除" ButtonType="PushButton"></asp:ButtonColumn>
<asp:HyperLinkColumn text="~辑" DataNavigateUrlField="pid" DataNavigateUrlFormatString="Update.aspx?pid={0}"></asp:HyperLinkColumn>
<asp:TemplateColumn>
<itemtemplate>
<asp:HyperLink Text="修改" NavigateUrl='<%#"Update.aspx?id="+DataBinder.Eval(Container.DataItem,"pid")+"&name="+DataBinder.Eval(Container.DataItem,"pname")%>' runat="server">
</asp:HyperLink>
</itemtemplate>
</asp:TemplateColumn>
</columns>
</asp:DataGrid>
</form>

 

 

 

 


 



]]>
我开发的BBS论坛http://www.aygfsteel.com/hayun/articles/asp5.html?/dc:creator>?/author>Mon, 20 Nov 2006 16:10:00 GMThttp://www.aygfsteel.com/hayun/articles/asp5.html首先启动IIS 下面坛图?












]]>
C#~写ATM模拟E序http://www.aygfsteel.com/hayun/articles/asp2.html?/dc:creator>?/author>Sun, 12 Nov 2006 14:55:00 GMThttp://www.aygfsteel.com/hayun/articles/asp2.html 先编写一个连接数据库的类
using System;

namespace ATM
{

 public class CheckProcess
 {
  public int tid;
  ConnDB db;
  public CheckProcess()
  {
    db=new ConnDB();
  }
  public bool checkUser(string name,string pass)
  {
   int a=db.examine(name,pass);
   if(a!=0)
   {
    return true;
   }
   return false;
  }
  public bool checknumber(string str){
  float f=float.Parse(str);
   if(f <=5000){
   return true;
   }
  return false;
  }
  public bool checkinput(string str)
  {
   char[] c= str.ToCharArray();
   for(int i=0;i<c.Length;i++)
   {
    if(c[i]<'.'||c[i]>'9'||c[i]=='/')
    {
     return false;
    }
   }
   return true;
  }
  public bool checkPassword(string str)
  {
   char[] c= str.ToCharArray();
   for(int i=0;i<c.Length;i++)
   {
    if(c[i]<'.'||c[i]>'9')
    {
     return false;
    }
   }
   return true;
  }
 }
}
下面是处理用戯入的c?
using System;

namespace ATM
{

 public class CheckProcess
 {
  public int tid;
  ConnDB db;
  public CheckProcess()
  {
    db=new ConnDB();
  }
  public bool checkUser(string name,string pass)
  {
   int a=db.examine(name,pass);
   if(a!=0)
   {
    return true;
   }
   return false;
  }
  public bool checknumber(string str){
  float f=float.Parse(str);
   if(f <=5000){
   return true;
   }
  return false;
  }
  public bool checkinput(string str)
  {
   char[] c= str.ToCharArray();
   for(int i=0;i<c.Length;i++)
   {
    if(c[i]<'.'||c[i]>'9'||c[i]=='/')
    {
     return false;
    }
   }
   return true;
  }
  public bool checkPassword(string str)
  {
   char[] c= str.ToCharArray();
   for(int i=0;i<c.Length;i++)
   {
    if(c[i]<'.'||c[i]>'9')
    {
     return false;
    }
   }
   return true;
  }
 }
}
Form1部分代码Q?/font>
  private void button1_Click(object sender, System.EventArgs e)
  {
   CheckProcess pro=new CheckProcess();
   name=text1.Text;
   pass=text2.Text;
   if(!name.Equals("")||!pass.Equals(""))
   {
    if(pro.checkUser(name,pass))
    {
     ConnDB db=new ConnDB();
     int a=db.getID(name,pass);
     ATM.Form2 f2=new Form2();
     f2.setUserID(a,name,pass);
     this.Hide();
     f2.Show();
    }
    else
    {
     MessageBox.Show("产生错误!");
    }
   }
   else
   {
    label3.ForeColor=System.Drawing.Color.Red;
    label3.Text="误入正的用户名或密码!";
   }
  }
Form2部分代码Q?/font>
  private int id;
  private string name;
  private string pwd;
  public void setUserID(int id,string name,string pwd){
  this.id=id;
  this.name = name;
  this.pwd=pwd;
  }
  private void Form2_Load(object sender, System.EventArgs e)
  {
   this.Text="Ƣ迎用户"+name+"登陆请选择您需要的操作";
  }
  private void button5_Click(object sender, System.EventArgs e)
  {
   ATM.Form1 f1=new Form1();
   this.Close();
   f1.Show();
  }
  private void button1_Click(object sender, System.EventArgs e)
  {
   ConnDB db=new ConnDB();
   ATM.Form3 f3=new Form3();
   string price=db.getPrice(id);
   f3.setUserID(id,price);
   f3.Show();
  }
  private void button3_Click(object sender, System.EventArgs e)
  {
   ConnDB db=new ConnDB();
   string price=db.getPrice(id);
   MessageBox.Show("你当前帐户余额ؓ:"+price+"?RMB)          ","用户"+name+"您好!",MessageBoxButtons.OK,MessageBoxIcon.Information);
  }

  private void button2_Click(object sender, System.EventArgs e)
  {
   ConnDB db=new ConnDB();
   string str =db.getPrice(id);
   ATM.Form4 f4=new Form4();
   f4.setUser(id,str);
   f4.Show();
  }

  private void button4_Click(object sender, System.EventArgs e)
  {
   ATM.Form5 f5=new Form5();
   f5.setUserName(name,pwd,id);
   f5.Show();
  }

form3部分代码Q?/font>
  private void button1_Click(object sender, System.EventArgs e)
  {
   ConnDB db=new ConnDB();
   CheckProcess p=new CheckProcess();
   if(!this.textBox1.Text.Equals("")&&this.textBox1.Text.Length<10)
   {
    if(p.checkinput(this.textBox1.Text)&&p.checknumber(this.textBox1.Text))
    {
     bool flan=db.ReduceMoney(this.textBox1.Text,id,price);
     if(flan)
     {
      MessageBox.Show("输入金额已成功取出           ?","Information",MessageBoxButtons.OK,MessageBoxIcon.Information);
      this.Close();
     }
     else
     {
      MessageBox.Show("对不?您的帐户不","Information",MessageBoxButtons.OK,MessageBoxIcon.Error);
      this.textBox1.Text="";
     }   
    }
    else
    {
     MessageBox.Show("您的输入有问题!","ERROR",MessageBoxButtons.OK,MessageBoxIcon.Error);
     this.textBox1.Text="";
    }
   }
   else
   {
    MessageBox.Show("产生错误请重新填?!","ERROR",MessageBoxButtons.OK,MessageBoxIcon.Error);
    this.textBox1.Text="";
   }
   }

form4部分代码Q?/font>
  private void button1_Click(object sender, System.EventArgs e)
  {
   ConnDB db=new ConnDB();
   CheckProcess p=new CheckProcess();
   if(!this.textBox1.Text.Equals("")&&this.textBox1.Text.Length < 10)
   {
    if(p.checkinput(this.textBox1.Text))
    {
     bool flan =db.AddMoney(this.textBox1.Text,id);
     if(flan)
     {
      MessageBox.Show("输入金额已成功存入帐?,"Information",MessageBoxButtons.OK,MessageBoxIcon.Information);
      this.Close();
     }
     else
     {
      MessageBox.Show("对不?  输入金额没有存入  请重新输?","ERROR",MessageBoxButtons.OK,MessageBoxIcon.Error);
      this.textBox1.Text="";
     }     
    }
    else
    {
     MessageBox.Show("误入数?","ERROR",MessageBoxButtons.OK,MessageBoxIcon.Error);
     this.textBox1.Text="";
    }
   }
   else
   {
    MessageBox.Show("产生错误!请重新输?","ERROR",MessageBoxButtons.OK,MessageBoxIcon.Error);
    this.textBox1.Text="";
   }
  }

form5部分代码:
  private void button1_Click(object sender, System.EventArgs e)
  {
   CheckProcess p=new CheckProcess();
   if(!this.textBox1.Text.Equals("")||!this.textBox2.Text.Equals(""))
   {
    if(this.textBox1.Text.Length == 6 || this.textBox2.Text.Length == 6)
    {
     if(p.checkPassword(this.textBox1.Text)&&p.checkPassword(this.textBox2.Text))
     {
      if(this.textBox1.Text.Equals(pwd))
      {
       ConnDB db=new ConnDB();
       bool flan=db.checkUserpass(this.textBox2.Text,id);
       if(flan)
       {
        MessageBox.Show("修改成功完成    ","Update Success",MessageBoxButtons.OK,MessageBoxIcon.Information);
        this.Close();
       }
       else
       {
        MessageBox.Show("对不?    修改p|!    ","ERROR",MessageBoxButtons.OK,MessageBoxIcon.Error);
        this.Close();
       }
      }
      else
      {
       MessageBox.Show("对不P您的密码不正?    ","ERROR",MessageBoxButtons.OK,MessageBoxIcon.Error);
       this.textBox1.Text="";
       this.textBox2.Text="";
      }
     }
     else
     {
      MessageBox.Show("误?~9之间的整敊W ?","ERROR",MessageBoxButtons.OK,MessageBoxIcon.Error);
      this.textBox1.Text="";
      this.textBox2.Text="";
     }       
    }
    else{
    MessageBox.Show("密码太长或太短请输入6位密码  ?","ERROR",MessageBoxButtons.OK,MessageBoxIcon.Error);
    this.textBox1.Text="";
    this.textBox2.Text="";
    }
   }
   else
   {
    MessageBox.Show("误入内容        ?","What way?",MessageBoxButtons.OK,MessageBoxIcon.Warning);
   }
  }



]]>
ASP数据库连?/title><link>http://www.aygfsteel.com/hayun/articles/asp.html</link><dc:creator>?/dc:creator><author>?/author><pubDate>Sat, 04 Nov 2006 16:35:00 GMT</pubDate><guid>http://www.aygfsteel.com/hayun/articles/asp.html</guid><description><![CDATA[<%<br />'以OLEDB形势讉KSQL Server数据?br /> set con=server.CreateObject("adodb.connection")<br /> con.connectionstring="provider=sqloledb;data source=.;uid=sa;pwd=;database=server"<br /> con.open<br /> set rs=server.CreateObject("adodb.recordset")<br /> sql="select * from kop"<br /> rs.open sql,con,2,3<br /> response.Write(rs("id")&"&nbsp;")<br /> response.Write(rs("name")&"&nbsp;")<br /> response.Write(rs("http")&"&nbsp;")<br /> response.Write(rs("adds")&"&nbsp;")<br />%><br /><br /><%<br />'以OLEDB形势讉KAccess数据?br /> set con=server.CreateObject("adodb.connection")<br /> con.connectionstring="provider=microsoft.jet.oledb.4.0;data source="&MapPath("color.mdb")<br /> con.open<br /> set rs=server.CreateObject("adodb.recordset")<br /> sql="select * from class1"<br /> rs.open sql,con,2,3<br /> response.Write(rs("id")&"&nbsp;")<br /> response.Write(rs("name")&"&nbsp;")<br /> response.Write(rs("http")&"&nbsp;")<br /> response.Write(rs("fileworks")&"&nbsp;")<br />%><img src ="http://www.aygfsteel.com/hayun/aggbug/79141.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/hayun/" target="_blank">?/a> 2006-11-05 00:35 <a href="http://www.aygfsteel.com/hayun/articles/asp.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <a href="http://www.aygfsteel.com/" title="狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频">狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频</a> </div> </footer> վ֩ģ壺 <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">лͨ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">̨</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">Ұ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ɽ</a>| <a href="http://" target="_blank">¹</a>| <a href="http://" target="_blank">ɳ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">Դ</a>| <a href="http://" target="_blank">ɳ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">Ʊ</a>| <a href="http://" target="_blank">ʯ</a>| <a href="http://" target="_blank">ͼ</a>| <a href="http://" target="_blank">ŷ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ˮ</a>| <a href="http://" target="_blank">¡Ң</a>| <a href="http://" target="_blank">ƽ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ȫ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">Դ</a>| <a href="http://" target="_blank">ͨ</a>| <a href="http://" target="_blank">ֵ</a>| <a href="http://" target="_blank">Ϫ</a>| <a href="http://" target="_blank"></a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>