📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "密码解密"
ClientHeight = 3765
ClientLeft = 60
ClientTop = 345
ClientWidth = 5985
LinkTopic = "Form1"
ScaleHeight = 3765
ScaleWidth = 5985
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton cmdcls
Caption = "请屏"
Height = 375
Left = 480
TabIndex = 6
Top = 3000
Width = 975
End
Begin VB.TextBox txtrecode
Height = 375
Left = 1920
TabIndex = 5
Top = 2160
Width = 2655
End
Begin VB.TextBox txtcode
Height = 375
Left = 1920
TabIndex = 4
Top = 1320
Width = 2655
End
Begin VB.CommandButton cmdrecode
Caption = "解密"
Height = 375
Left = 480
TabIndex = 3
Top = 2160
Width = 975
End
Begin VB.CommandButton cmdcode
Caption = "加密"
Height = 375
Left = 480
TabIndex = 2
Top = 1320
Width = 975
End
Begin VB.TextBox txtinput
Height = 375
Left = 1920
TabIndex = 1
Top = 480
Width = 2655
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "输入字符串"
Height = 180
Left = 600
TabIndex = 0
Top = 600
Width = 900
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim strinput As String * 70, code As String * 70
Dim recode As String, strtemp As String * 1
Dim i As Integer, length As Integer
Dim iasc As Integer
Private Sub cmdcls_Click()
txtcode.Text = ""
txtrecode.Text = ""
txtinput.Text = ""
End Sub
Private Sub cmdcode_Click()
strinput = txtinput.Text
i = 1
code = ""
length = Len(RTrim(strinput))
Do While (i <= length)
strtemp = Mid$(strinput, i, 1)
If (strtemp >= "A" And strtemp <= "Z") Then
iasc = Asc(strtemp) + 5
If iasc > Asc("Z") Then iasc = iasc - 26
code = Chr$(iasc)
txtcode.Text = RTrim(txtcode.Text) & RTrim(code)
ElseIf (strtemp >= "a" And strtemp <= "z") Then
iasc = Asc(strtemp) + 5
If iasc > Asc("z") Then iasc = iasc - 26
code = Chr$(iasc)
txtcode.Text = RTrim(txtcode.Text) & RTrim(code)
ElseIf (strtemp >= "0" And strtemp <= "9") Then
iasc = strtemp + 5
If iasc > "9" Then iasc = iasc - 10
txtcode.Text = RTrim(txtcode.Text) & RTrim(iasc)
Else
code = strtemp
txtcode.Text = RTrim(txtcode.Text) & RTrim(code)
End If
i = i + 1
Loop
End Sub
Private Sub cmdrecode_Click()
strinput = txtcode.Text
i = 1
code = ""
length = Len(RTrim(strinput))
Do While (i <= length)
strtemp = Mid$(strinput, i, 1)
If (strtemp >= "A" And strtemp <= "Z") Then
iasc = Asc(strtemp) - 5
If iasc < Asc("A") Then iasc = iasc + 26
code = Chr$(iasc)
txtrecode.Text = RTrim(txtrecode.Text) & RTrim(code)
ElseIf (strtemp >= "a" And strtemp <= "z") Then
iasc = Asc(strtemp) - 5
If iasc < Asc("a") Then iasc = iasc + 26
code = Chr$(iasc)
txtrecode.Text = RTrim(txtrecode.Text) & RTrim(code)
ElseIf (strtemp >= "0" And strtemp <= "9") Then
iasc = strtemp - 5
If iasc < "0" Then iasc = iasc + 10
txtrecode.Text = RTrim(txtrecode.Text) & RTrim(iasc)
Else
code = strtemp
txtrecode.Text = RTrim(txtrecode.Text) & RTrim(code)
End If
i = i + 1
Loop
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -