frmgetkid.frm

来自「一个完整的非接触IC卡会员管理系统」· FRM 代码 · 共 279 行

FRM
279
字号
VERSION 5.00
Begin VB.Form frmGetKID 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "注册机"
   ClientHeight    =   2760
   ClientLeft      =   36
   ClientTop       =   432
   ClientWidth     =   6312
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   2760
   ScaleWidth      =   6312
   ShowInTaskbar   =   0   'False
   StartUpPosition =   3  '窗口缺省
   Begin VB.TextBox Text6 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   370
      Left            =   5160
      MaxLength       =   4
      TabIndex        =   9
      Top             =   360
      Width           =   852
   End
   Begin VB.TextBox Text5 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   370
      Left            =   4200
      MaxLength       =   4
      TabIndex        =   8
      Top             =   360
      Width           =   852
   End
   Begin VB.TextBox Text4 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   370
      Left            =   3240
      MaxLength       =   4
      TabIndex        =   7
      Top             =   360
      Width           =   852
   End
   Begin VB.TextBox Text3 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   370
      Left            =   2280
      MaxLength       =   4
      TabIndex        =   6
      Top             =   360
      Width           =   852
   End
   Begin VB.TextBox Text2 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   370
      Left            =   1320
      MaxLength       =   4
      TabIndex        =   4
      Top             =   360
      Width           =   852
   End
   Begin VB.CommandButton Command1 
      Caption         =   "确定"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.8
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   490
      Left            =   1800
      TabIndex        =   2
      Top             =   2040
      Width           =   1450
   End
   Begin VB.TextBox Text1 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.8
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   370
      Left            =   1320
      TabIndex        =   1
      Top             =   1080
      Width           =   3612
   End
   Begin VB.CommandButton Command2 
      Caption         =   "退出"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.8
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   490
      Left            =   3360
      TabIndex        =   0
      Top             =   2040
      Width           =   1330
   End
   Begin VB.Label Label1 
      Caption         =   "注册码:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   372
      Left            =   360
      TabIndex        =   5
      Top             =   360
      Width           =   1332
   End
   Begin VB.Label Label3 
      Caption         =   "注册码:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   372
      Left            =   360
      TabIndex        =   3
      Top             =   1080
      Width           =   1332
   End
End
Attribute VB_Name = "frmGetKID"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
    Dim strKey As String
    Dim skeyPi(8) As Byte
    Dim skeyID(8) As Byte
    Dim skeyLA(8) As Byte
    Dim i As Integer
    Dim n As Integer
    Dim snn As String
    
    snn = Text3.Text & Text4.Text & Text5.Text & Text6.Text
    If Len(snn) <> 16 Then Exit Sub
    
    n = 1
    For i = 0 To 7
        skeyID(i) = "&H" + Mid(snn, n, 2)
        n = n + 2
    Next i
    skeyPi(0) = &HAA
    skeyPi(1) = &H19
    skeyPi(2) = &HBB
    skeyPi(3) = &H76
    skeyPi(4) = &HCC
    skeyPi(5) = &H4
    skeyPi(6) = &HDD
    skeyPi(7) = &H19
    st = ic_encrypt(skeyPi(0), skeyID(0), 8, skeyLA(0))
    strKey = ""
    For i = 0 To 7
        strKey = strKey & Right("00" + Hex(skeyLA(i)), 2)
    Next i
    Text1.Text = strKey
    
End Sub

Private Sub Command2_Click()
Unload Me
End Sub

Private Sub Form_Load()
    Me.Top = (Screen.Height - Me.Height) / 2
    Me.Left = (Screen.Width - Me.Width) / 2
End Sub

Private Sub Text2_Change()
If Len(Text2) = 4 Then Text3.SetFocus
End Sub
Private Sub Text3_Change()
If Len(Text3) = 4 Then Text4.SetFocus
End Sub
Private Sub Text4_Change()
If Len(Text4) = 4 Then Text5.SetFocus
End Sub
Private Sub Text5_Change()
If Len(Text5) = 4 Then Text6.SetFocus
End Sub
Private Sub Text6_Change()
If Len(Text6) = 4 Then Command1.SetFocus
End Sub
Private Sub text2_KeyPress(KeyAscii As Integer)
    If KeyAscii > 57 Or KeyAscii < 48 And KeyAscii <> 8 Then
            KeyAscii = 0
    End If
    
End Sub
Private Sub text3_KeyPress(KeyAscii As Integer)
    If KeyAscii > 57 Or KeyAscii < 48 And KeyAscii <> 8 Then
            KeyAscii = 0
    End If
   
End Sub
Private Sub text4_KeyPress(KeyAscii As Integer)
    If KeyAscii > 57 Or KeyAscii < 48 And KeyAscii <> 8 Then
            KeyAscii = 0
    End If
    
End Sub
Private Sub text5_KeyPress(KeyAscii As Integer)
    If KeyAscii > 57 Or KeyAscii < 48 And KeyAscii <> 8 Then
            KeyAscii = 0
    End If
   
End Sub
Private Sub text6_KeyPress(KeyAscii As Integer)
    If KeyAscii > 57 Or KeyAscii < 48 And KeyAscii <> 8 Then
            KeyAscii = 0
    End If
    
End Sub

⌨️ 快捷键说明

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