📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 3435
ClientLeft = 60
ClientTop = 450
ClientWidth = 9915
LinkTopic = "Form1"
Picture = "Form1.frx":0000
ScaleHeight = 3435
ScaleWidth = 9915
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command2
Caption = "解密并存盘"
Height = 255
Left = 7320
TabIndex = 7
Top = 360
Width = 1575
End
Begin VB.CommandButton Command1
Caption = "加密并存盘"
Height = 255
Left = 3480
TabIndex = 6
Top = 360
Width = 1575
End
Begin VB.TextBox Text2
Height = 735
Left = 3360
TabIndex = 5
Top = 2640
Width = 6375
End
Begin VB.TextBox Text1
Height = 735
Left = 3480
TabIndex = 4
Top = 1080
Width = 6375
End
Begin VB.FileListBox File1
Height = 2610
Left = 1920
TabIndex = 3
Top = 720
Width = 1335
End
Begin VB.DriveListBox Drive1
Height = 300
Left = 120
TabIndex = 2
Top = 120
Width = 1695
End
Begin VB.DirListBox Dir1
Height = 2820
Left = 120
TabIndex = 1
Top = 600
Width = 1695
End
Begin VB.ComboBox Combo1
Height = 300
Left = 1920
TabIndex = 0
Top = 240
Width = 1335
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "解密后文字OR原文字"
Height = 180
Left = 3600
TabIndex = 9
Top = 2400
Width = 1620
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "加密前文字OR密码文字"
Height = 180
Left = 3480
TabIndex = 8
Top = 840
Width = 1800
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
End Sub
Private Sub Dir1_Change()
File1.Path = Dir1.Path
End Sub
Private Sub Form_Load()
Combo1.AddItem "*.txt"
Combo1.AddItem "*.dat"
Combo1.Text = "*.txt"
File1.Pattern = "*.txt"
End Sub
Private Sub File1_Click()
Select Case Combo1.Text
Case "*.txt"
File1.Pattern = "*.txt"
Case "*.dat"
File1.Pattern = "*.dat"
End Select
End Sub
Sub file1_DblClick()
Dim inputdata As String * 1
tfilename = IIf(Right(File1.Path, 1) = " \ ", File1.Path + File1.FileName, File1.Path + "\" + File1.FileName)
Open tfilename For Input As #1
Text1.Text = " "
Do While Not EOF(1)
enputdata = Input(1, #1)
Text1.Text = Text1.Text + enputdata
Loop
Close #1
End Sub
Private Sub Command1_Click()
Dim strinput$, code$, record$, c As String * 1
Dim i%, length%, iasc%
strinput = Text1.Text
length = Len(RTrim(strinput))
code = ""
For i = 1 To length
c = Mid(strinput, i, 1)
Select Case c
Case "A" To "Z"
iasc = Asc(c) + 5
If iasc > Asc("Z") Then iasc = iasc - 26
code = code + Chr(iasc)
Case "a" To "z"
iasc = Asc(c) + 5
If iasc > Asc("z") Then iasc = iasc - 26
code = code + Chr(iasc)
Case Else
code = code + c
End Select
Next i
Text2.Text = code
tfilename = IIf(Right(File1.Path, 1) = " \ ", File1.Path + File1.FileName, File1.Path + "\" + File1.FileName)
Open tfilename For Output As #1
For i = 1 To Len(Text1.Text)
Print #1, Mid(Text2.Text, i, 1);
Next i
Close #1
End Sub
Private Sub Command2_Click()
Dim strinput$, code$, record$, c As String * 1
Dim i%, length%, iasc%
strinput = Text1.Text
length = Len(RTrim(strinput))
code = ""
For i = 1 To length
c = Mid(strinput, i, 1)
Select Case c
Case "A" To "Z"
iasc = Asc(c) - 5
If iasc < Asc("A") Then iasc = iasc + 26
code = code + Chr(iasc)
Case "a" To "z"
iasc = Asc(c) - 5
If iasc < Asc("a") Then iasc = iasc + 26
code = code + Chr(iasc)
Case Else
code = code + c
End Select
Next i
Text2.Text = code
tfilename = IIf(Right(File1.Path, 1) = " \ ", File1.Path + File1.FileName, File1.Path + "\" + File1.FileName)
Open tfilename For Output As #1
For i = 1 To Len(Text2.Text)
Print #1, Mid(Text2.Text, i, 1);
Next i
Close #1
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -