📄 vaildgen.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "图形信息校验码识别程序 http://www.codesky.net"
ClientHeight = 3915
ClientLeft = 60
ClientTop = 345
ClientWidth = 7140
LinkTopic = "Form1"
ScaleHeight = 3915
ScaleWidth = 7140
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command2
Caption = "退出"
Height = 420
Left = 2805
TabIndex = 13
Top = 3435
Width = 1290
End
Begin VB.CommandButton Command1
Caption = "关于"
Height = 420
Left = 1410
TabIndex = 12
Top = 3435
Width = 1290
End
Begin VB.TextBox txtLen
Height = 285
Left = 1665
TabIndex = 11
Text = "8"
Top = 2235
Width = 750
End
Begin VB.TextBox txtCode
Height = 330
Left = 4065
TabIndex = 9
Top = 150
Width = 1695
End
Begin VB.CommandButton cmdCheck
Caption = "验证"
Height = 420
Left = 4065
TabIndex = 8
Top = 495
Width = 1755
End
Begin VB.CheckBox chkJump
Caption = "显示弯曲文字"
Height = 270
Left = 3450
TabIndex = 6
Top = 1830
Width = 1815
End
Begin VB.CommandButton cmdGenCode
Caption = "生成代码"
Height = 420
Left = 30
TabIndex = 5
Top = 3435
Width = 1290
End
Begin VB.ComboBox CboBack
Height = 315
Left = 2025
TabIndex = 4
Top = 1830
Width = 1290
End
Begin VB.ComboBox CboTypeA
Height = 315
ItemData = "VaildGen.frx":0000
Left = 285
List = "VaildGen.frx":0002
TabIndex = 2
Top = 1830
Width = 1650
End
Begin VB.PictureBox Picture1
BeginProperty Font
Name = "Comic Sans MS"
Size = 21.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 210
ScaleHeight = 435
ScaleWidth = 1155
TabIndex = 0
Top = 60
Width = 1215
End
Begin VB.Image Image1
Height = 450
Left = 6030
Picture = "VaildGen.frx":0004
Top = 3405
Visible = 0 'False
Width = 900
End
Begin VB.Image ImgPatten
Height = 450
Index = 5
Left = 6030
Picture = "VaildGen.frx":1560
Top = 3405
Width = 900
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "验证码长度:"
Height = 180
Left = 240
TabIndex = 10
Top = 2295
Width = 1080
End
Begin VB.Image ImgPatten
Height = 450
Index = 4
Left = 6030
Picture = "VaildGen.frx":2ABC
Top = 2850
Width = 900
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "背景图片"
Height = 180
Left = 6105
TabIndex = 7
Top = 150
Width = 720
End
Begin VB.Image ImgPatten
Height = 450
Index = 3
Left = 6030
Picture = "VaildGen.frx":4018
Top = 2310
Width = 900
End
Begin VB.Image ImgPatten
Height = 450
Index = 2
Left = 6030
Picture = "VaildGen.frx":5572
Top = 1665
Width = 900
End
Begin VB.Image ImgPatten
Height = 450
Index = 1
Left = 6030
Picture = "VaildGen.frx":6ACC
Top = 1035
Width = 900
End
Begin VB.Image ImgPatten
Height = 450
Index = 0
Left = 6030
Picture = "VaildGen.frx":8026
Top = 435
Width = 900
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "背景样式:"
Height = 180
Left = 2145
TabIndex = 3
Top = 1575
Width = 900
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "校验码类型:"
Height = 180
Left = 285
TabIndex = 1
Top = 1560
Width = 1080
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private CodeCheck As New ClsCodeCheck
Dim VType As Integer, JumpyText As Boolean
Function FixPath(lPath As String) As String
If Right(lPath, 1) <> "\" Then
FixPath = lPath & "\"
Else
FixPath = lPath
End If
End Function
Sub GenVaildID()
With CodeCheck
.Patten = Image1.Picture
.VerificationType = VType
.BorderColor = vbYellow
.ForeColor = vbBlack
.JumbleText = chkJump
.VerificationLength = Val(txtLen.Text)
.UsePatten = CBool(CboBack.ListIndex)
End With
CodeCheck.GenVerification Picture1
End Sub
Private Sub Command2_Click()
Unload Form1
End Sub
Private Sub CboBack_Click()
cmdGenCode_Click
End Sub
Private Sub CboTypeA_Click()
VType = CboTypeA.ListIndex
cmdGenCode_Click
End Sub
Private Sub Command1_Click()
MsgBox "图形信息校验码识别程序" _
& vbCrLf & vbTab & " 欢迎光临枕善居", vbInformation, "关于"
End Sub
Private Sub chkJump_Click()
cmdGenCode_Click
End Sub
Private Sub cmdCheck_Click()
If Not CodeCheck.VerificationGood(txtCode.Text) Then
MsgBox "验证码不正确." _
& vbCrLf & "请重新输入.", vbCritical Or vbExclamation, "验证失败"
Exit Sub
Else
MsgBox "校验码正确无误.", vbInformation, "校验成功"
End If
End Sub
Private Sub cmdGenCode_Click()
GenVaildID
End Sub
Private Sub Form_Load()
'Add some random words
CodeCheck.AddRandomWord "Piggy"
CodeCheck.AddRandomWord "GoGoTa Go"
CodeCheck.AddRandomWord "YeYa He"
CodeCheck.AddRandomWord "Wlolla"
CodeCheck.AddRandomWord "IcyTicky"
CodeCheck.AddRandomWord "HonkeyTonkey"
CodeCheck.AddRandomWord "Wonkey Donkey"
CodeCheck.AddRandomWord "AveIT"
CodeCheck.AddRandomWord "Borland"
CodeCheck.AddRandomWord "VerificationCode"
CodeCheck.AddRandomWord "HickyDickyDot"
CodeCheck.AddRandomWord "AveIT"
CodeCheck.AddRandomWord "NumSkull"
CodeCheck.AddRandomWord "Idiot2009"
CodeCheck.AddRandomWord "Yo,xyz"
CodeCheck.AddRandomWord "Qwerty"
CodeCheck.AddRandomWord "
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -