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

📄 form1.frm

📁 vb 简单学习加密解密算法。共大家学习使用
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   3630
   ClientLeft      =   60
   ClientTop       =   390
   ClientWidth     =   4560
   LinkTopic       =   "Form1"
   ScaleHeight     =   3630
   ScaleWidth      =   4560
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Command3 
      Caption         =   "检验"
      Height          =   375
      Left            =   2040
      TabIndex        =   5
      Top             =   3120
      Width           =   735
   End
   Begin VB.TextBox Text3 
      Height          =   495
      Left            =   960
      TabIndex        =   4
      Text            =   "Text3"
      Top             =   2280
      Width           =   2655
   End
   Begin VB.CommandButton Command2 
      Caption         =   "解密"
      Height          =   375
      Left            =   1920
      TabIndex        =   3
      Top             =   1800
      Width           =   855
   End
   Begin VB.TextBox Text2 
      Height          =   375
      Left            =   960
      TabIndex        =   2
      Text            =   "Text2"
      Top             =   1200
      Width           =   2655
   End
   Begin VB.CommandButton Command1 
      Caption         =   "加密"
      Height          =   255
      Left            =   1920
      TabIndex        =   1
      Top             =   840
      Width           =   735
   End
   Begin VB.TextBox Text1 
      Height          =   375
      Left            =   960
      TabIndex        =   0
      Text            =   "Text1"
      Top             =   240
      Width           =   2655
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
     On Error Resume Next
    Dim plen As Integer, order As String, i As Integer, s As String
    s = Text1.Text
    plen = Len(s)
    order = (Int(Rnd * 10))
    order = order & 9
    order = order & Int(Rnd * 10)
    For i = 1 To Len(s)
        order = order & 518 - Asc(Right(Left(s, i), 1))
    Next
    
    Text2.Text = ""
    'Text2.Text = (Val(order) + 916) * 2
    Text2.Text = order
End Sub

Private Sub Command2_Click()
    Dim i As Integer, order As String, temp As String, s As String
     On Error Resume Next
     s = Text2.Text
    s = Right(s, Len(s) - 3)
    For i = 1 To Int(Len(s) / 3)
        temp = Left(s, 3)
        s = Right(s, Len(s) - 3)
        order = order & Chr(518 - Val(temp))
    Next i
    Text3.Text = order
End Sub

Private Sub Command3_Click()
If Text1.Text = Text3.Text Then
MsgBox "相符"
Else
MsgBox "有误"
End If
End Sub

⌨️ 快捷键说明

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