| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 739 人关注过本帖
标题:验证码识别程序的问题!
只看楼主 加入收藏
tig2
Rank: 2
等 级:论坛游民
帖 子:57
专家分:45
注 册:2007-4-11
结帖率:0
收藏
 问题点数:0 回复次数:1 
验证码识别程序的问题!
这几天从网上下载下了个验证码识别的源代码,样版已经更改过了!验证码还是无法识别!郁闷哈!!
请各位大牛帮看看是什么原因!随便也注解一下哈!!谢谢!

Private WordX As String, WordY As String, Word26(26) As String
Private Declare Function GetPixel Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long) As Long
Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function SetCursorPos Lib "user32" (ByVal x As Long, ByVal y As Long) As Long
Private Declare Function ReleaseDC Lib "user32" (ByVal hwnd As Long, ByVal hdc As Long) As Long
'//本程序没什么技术含量,也不是真正意义是图象识别技术.纯粹写着玩,今天晚上太无聊了.哎~~
'//      -----------   BY: 一周八天@
Private Sub Command1_Click()
Command1.Enabled = False
If Len(Text1.Text) = 5 Then Text1.Text = ""
Static Words As Byte
WordY = (Me.Top + Picture1.Top) / Screen.TwipsPerPixelY + 4
WordX = (Me.Left + Picture1.Left) / Screen.TwipsPerPixelX + 5 + (Words) * 9
Dim tempColor As Long
Dim i As Byte, x As Byte, y As Byte, arrColor(54) As Boolean
Dim dc
dc = GetDC(0)
i = 1
For y = 0 To 8
    For x = 0 To 5
    Print WordX + x, WordY + y
    tempColor = GetPixel(dc, WordX + x, WordY + y)
'    SetCursorPos WordX + x, WordY + y - 1
'Print tempColor
    arrColor(i) = False
    If (tempColor - 3200000) > 0 Then arrColor(i) = True
    i = i + 1
    Next
Next
Dim w As Integer, Best As Byte, Temp As Byte, bestIndex As Byte
For w = 1 To 10
    Temp = 0
    For i = 1 To 54
    If arrColor(i) = Mid(Word26(w), i, 1) Then Temp = Temp + 1
    Next
    If Temp > Best Then Best = Temp: bestIndex = w
Next
Text1.Text = Text1.Text & bestIndex ' Chr(64 + bestIndex)
If Words < 3 Then
Words = Words + 1
Command1_Click
Else
Words = 0
Command1.Enabled = True
End If
ReleaseDC 0, dc
End Sub
Private Sub Form_Load()
Picture1.Picture = LoadPicture("G:\VB\网页\4.jpg")
'采样(本程序修改后完成的此功能.)
Word26(1) = "001100010010100001100001100001100001100001010010001100"
Word26(2) = "001100010100000100000100000100000100000100000100011111"
Word26(3) = "111100000010000010000010000100001000010000100000111110"
Word26(4) = "111100000010000010000100011000000100000010000010011100"
Word26(5) = "000010000110001010010010100010111111000010000010000010"
Word26(6) = "111110100000100000111000000100000010000010000100111000"
Word26(7) = "001111010000100000101100110010100001100001010010001100"
Word26(8) = "111111000001000010000100000100001000001000010000010000"
Word26(9) = "011110100001100001010010011110100001100001100001011110"
Word26(10) = "001100010010100001100001010011001101000001000010111100"
End Sub
Private Sub Label1_Click()
Unload Me
End Sub

[[it] 本帖最后由 tig2 于 2008-4-17 01:00 编辑 [/it]]

26.jpg (951 Bytes)
图片附件: 游客没有浏览图片的权限,请 登录注册


adf.jpg (938 Bytes)
图片附件: 游客没有浏览图片的权限,请 登录注册
搜索更多相关主题的帖子: 验证 
2008-04-17 00:59
tig2
Rank: 2
等 级:论坛游民
帖 子:57
专家分:45
注 册:2007-4-11
收藏
得分:0 
顶起来。!!等待会的人!
2008-04-17 18:36
快速回复:验证码识别程序的问题!
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.046380 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved