⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form1.frm

📁 图灵识别这个代码是作为学习之用
💻 FRM
字号:
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Begin VB.Form Form1 
   AutoRedraw      =   -1  'True
   Caption         =   "验证码识别"
   ClientHeight    =   6780
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   10755
   LinkTopic       =   "Form1"
   ScaleHeight     =   6780
   ScaleWidth      =   10755
   StartUpPosition =   2  '屏幕中心
   Begin 工程1.HttpSocket HttpSocket1 
      Height          =   255
      Left            =   10320
      TabIndex        =   13
      Top             =   600
      Width           =   375
      _extentx        =   661
      _extenty        =   450
   End
   Begin VB.PictureBox MaskColor 
      Height          =   315
      Left            =   2460
      ScaleHeight     =   255
      ScaleWidth      =   495
      TabIndex        =   12
      Top             =   120
      Width           =   555
   End
   Begin VB.CommandButton Cmd_PointColor 
      Caption         =   "点阵颜色"
      Height          =   345
      Left            =   4800
      TabIndex        =   11
      Top             =   90
      Width           =   1005
   End
   Begin MSComDlg.CommonDialog CommonDialog1 
      Left            =   9240
      Top             =   540
      _ExtentX        =   847
      _ExtentY        =   847
      _Version        =   393216
   End
   Begin VB.TextBox CodeImageUrl 
      Appearance      =   0  'Flat
      Height          =   285
      Left            =   1020
      TabIndex        =   10
      Text            =   "http://piglogin.zhongsou.com/club1/pic.aspx"
      Top             =   1140
      Width           =   7935
   End
   Begin VB.CommandButton Cmd_Font_Jian 
      Caption         =   "Font -"
      Height          =   345
      Left            =   7050
      TabIndex        =   6
      Top             =   90
      Width           =   915
   End
   Begin VB.CommandButton Cmd_Font_Ja 
      Caption         =   "Font +"
      Height          =   345
      Left            =   6000
      TabIndex        =   5
      Top             =   90
      Width           =   915
   End
   Begin VB.TextBox Text1 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   5.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000002&
      Height          =   5025
      Left            =   150
      MultiLine       =   -1  'True
      ScrollBars      =   3  'Both
      TabIndex        =   4
      Top             =   1590
      Width           =   10425
   End
   Begin VB.TextBox txtCode 
      Appearance      =   0  'Flat
      Height          =   300
      Left            =   1020
      TabIndex        =   3
      Top             =   600
      Width           =   1305
   End
   Begin VB.CommandButton CmdGetPic 
      Caption         =   "获取图片"
      Height          =   345
      Left            =   9420
      TabIndex        =   2
      Top             =   90
      Width           =   1125
   End
   Begin VB.CommandButton CmdGetCode 
      Caption         =   "解析数字"
      Height          =   345
      Left            =   8130
      TabIndex        =   1
      Top             =   90
      Width           =   1125
   End
   Begin VB.PictureBox pic1 
      Appearance      =   0  'Flat
      AutoRedraw      =   -1  'True
      AutoSize        =   -1  'True
      BackColor       =   &H80000005&
      BorderStyle     =   0  'None
      ForeColor       =   &H80000008&
      Height          =   300
      Left            =   1020
      ScaleHeight     =   20
      ScaleMode       =   3  'Pixel
      ScaleWidth      =   84
      TabIndex        =   0
      Top             =   120
      Width           =   1260
   End
   Begin VB.Label Label3 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "解析结果:"
      Height          =   180
      Left            =   180
      TabIndex        =   9
      Top             =   660
      Width           =   810
   End
   Begin VB.Label Label2 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "图片地址:"
      Height          =   180
      Left            =   180
      TabIndex        =   8
      Top             =   1170
      Width           =   810
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "解析图片:"
      Height          =   180
      Left            =   180
      TabIndex        =   7
      Top             =   180
      Width           =   810
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long)


Private Sub Cmd_Font_Ja_Click()
    Text1.FontSize = Text1.FontSize + 1
End Sub

Private Sub Cmd_Font_Jian_Click()
    Text1.FontSize = Text1.FontSize - 1
End Sub

Private Sub Cmd_PointColor_Click()
On Error Resume Next
    CommonDialog1.ShowColor
    Text1.ForeColor = CommonDialog1.Color
End Sub

Private Sub CmdGetCode_Click()
    Dim cGC As New clsGetCode
    txtCode = cGC.GetCode(pic1)
    Text1.Text = cGC.ViewString
End Sub

Private Sub CmdGetPic_Click()
    
    If CodeImageUrl.Text = "" Then Exit Sub
    
    With HttpSocket1
        .Http_Ver = V11
        .RequestUrl = CodeImageUrl.Text
        '.SendData = "dorequest_bc&word1=%D3%E9%C0%D6%D0%DD%CF%D0"
        .AddHeader "Accept", "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/msword, */*"
        .AddHeader "Accept-Language", "zh-cn"
        '.AddHeader "Accept-Encoding", "gzip, deflate"
        .AddHeader "User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"
        .AddHeader "Host", .RemoteHost
        .AddHeader "Connection", "Close"
        .SendRequest
    End With
    
End Sub

Private Sub Form_Resize()
    If Me.WindowState <> 1 Then
        Text1.Width = Me.ScaleWidth - Text1.Left * 2
        Text1.Height = Me.ScaleHeight - Text1.Top - Text1.Left
        CodeImageUrl.Width = Me.ScaleWidth - CodeImageUrl.Left - Text1.Left
    End If
End Sub


Private Sub HttpSocket1_OnRecvOver()
    Dim fn As Integer
    Dim buff() As Byte
    Dim Temp() As Byte
    
    Debug.Print HttpSocket1.ResponseHeader

    buff() = HttpSocket1.ResponseBody
    
    
    Dim savefile As String

    savefile = App.Path & "\temp.jpg"
    'Debug.Print savefile

    If Dir(savefile) <> "" Then Kill (savefile)

    fn = FreeFile

    'Open a binary file and load data into it!
    Open savefile For Binary Access Write As #fn
    Put #fn, , buff()
    DoEvents
    'Close the open file
    Close #fn
    
    pic1.Picture = LoadPicture(savefile)
End Sub

Private Sub MaskColor_Click()
On Error Resume Next
    CommonDialog1.ShowColor
    MaskColor.BackColor = CommonDialog1.Color
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -