Anonymous 發表於 2011-10-7 17:48:33

仿圖片認證碼

源碼:


'delay

Private Sub Delay(ASecond As Integer)

    Dim t

    t = Timer

    Do

    DoEvents

    Loop Until (Int(Timer - t) = ASecond)

End Sub





Private Sub Form_Load()



Timer1.Enabled = True

Timer1.Interval = 10



End Sub





Private Sub Command1_Click()



Timer1.Enabled = True



End Sub



Private Sub Text1_Change()



ans = Label1.Caption & Label2.Caption & Label3.Caption & Label4.Caption & Label5.Caption & Label6.Caption

If Text1.Text = ans Then

Label7.Caption = "√ 輸入正確"

Label7.ForeColor = &H8000&

Else

Label7.Caption = "╳ 輸入錯誤"

Label7.ForeColor = &HFF&

End If



End Sub





Private Sub Timer1_Timer()



Randomize '隨機產生



For i = 1 To 150

Label1.Caption = Int((9 * Rnd) + 1)  '數字

Label1.FontSize = Int((40 - 15 + 1) * Rnd + 15)  '大小

Label1.ForeColor = RGB(Int(255 * Rnd), Int(255 * Rnd), Int(255 * Rnd))  '顏色



Label2.Caption = Int((9 * Rnd) + 1) '類推...

Label2.FontSize = Int((40 - 15 + 1) * Rnd + 15)

Label2.ForeColor = RGB(Int(255 * Rnd), Int(255 * Rnd), Int(255 * Rnd))



Label3.Caption = Int((9 * Rnd) + 1)

Label3.FontSize = Int((40 - 15 + 1) * Rnd + 15)

Label3.ForeColor = RGB(Int(255 * Rnd), Int(255 * Rnd), Int(255 * Rnd))



Label4.Caption = Int((9 * Rnd) + 1)

Label4.FontSize = Int((40 - 15 + 1) * Rnd + 15)

Label4.ForeColor = RGB(Int(255 * Rnd), Int(255 * Rnd), Int(255 * Rnd))



Label5.Caption = Int((9 * Rnd) + 1)

Label5.FontSize = Int((40 - 15 + 1) * Rnd + 15)

Label5.ForeColor = RGB(Int(255 * Rnd), Int(255 * Rnd), Int(255 * Rnd))



Label6.Caption = Int((9 * Rnd) + 1)

Label6.FontSize = Int((40 - 15 + 1) * Rnd + 15)

Label6.ForeColor = RGB(Int(255 * Rnd), Int(255 * Rnd), Int(255 * Rnd))



Delay (0.5)



Next



Timer1.Enabled = False

End Sub

dog123 發表於 2011-11-14 12:03:15

來看看是怎麼寫的
謝謝樓主

luck04 發表於 2011-12-6 20:54:05

高手出招  受教了

ok387056 發表於 2011-12-22 09:32:33

boyissky 發表於 2011-12-22 10:14:20

偷看一下  好新奇@@

a6935715 發表於 2011-12-23 21:32:55

汝汝 發表於 2011-12-24 12:06:32

xx690822 發表於 2011-12-24 22:52:30

s599601 發表於 2012-1-16 23:05:12

miss8164881212 發表於 2012-1-16 23:05:57

努力向上的學習

a00312977 發表於 2012-1-16 23:09:01

來看看這是甚麼東西  好奇中!!

ZhangBowei 發表於 2012-1-18 19:45:06

仿驗證碼 跟 連結中的網頁驗證碼一至?

這對快速註冊某某某應該有效

g940143 發表於 2012-1-18 20:00:08

這要幹嘛
:(

fung217 發表於 2012-1-24 04:24:58

來看看是怎麼寫的

zaqzaq001 發表於 2012-2-4 00:42:36

頁: [1] 2 3 4 5 6 7 8 9 10
查看完整版本: 仿圖片認證碼