📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 4320
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 4320
ScaleWidth = 4680
StartUpPosition = 3 'Windows Default
Begin VB.CommandButton Command2
Caption = "Decrypt"
Height = 375
Left = 3360
TabIndex = 8
Top = 3840
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "Encrypt"
Height = 375
Left = 2040
TabIndex = 7
Top = 3840
Width = 1215
End
Begin VB.CheckBox Check1
Caption = "Use Base64"
Height = 255
Left = 240
TabIndex = 6
Top = 3840
Width = 1575
End
Begin VB.TextBox Text3
Height = 1095
Left = 120
MultiLine = -1 'True
TabIndex = 5
Text = "Form1.frx":0000
Top = 2520
Width = 4455
End
Begin VB.TextBox Text2
Height = 285
Left = 120
TabIndex = 3
Text = "Text2"
Top = 1800
Width = 4455
End
Begin VB.TextBox Text1
Height = 1095
Left = 120
MultiLine = -1 'True
TabIndex = 1
Text = "Form1.frx":0006
Top = 360
Width = 4455
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "Result"
Height = 195
Left = 120
TabIndex = 4
Top = 2280
Width = 450
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "Key"
Height = 195
Left = 120
TabIndex = 2
Top = 1560
Width = 270
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "Text to Encrypt or Decrypt"
Height = 195
Left = 120
TabIndex = 0
Top = 120
Width = 1860
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 DES As New DES56, B64 As New Base64
Private LastWidth As Long, LastHeight As Long
Private Sub Command1_Click()
DES.Key = Text2
If Check1.Value Then
Text3 = B64.Encode(DES.Encrypt(Text1))
Else
Text3 = DES.Encrypt(Text1)
End If
End Sub
Private Sub Command2_Click()
DES.Key = Text2
If Check1.Value Then
Text3 = DES.Decrypt(B64.Decode(Text1))
Else
Text3 = DES.Decrypt(Text1)
End If
End Sub
Private Sub Form_Load()
LastWidth = Width
LastHeight = Height
End Sub
Private Sub Form_Resize()
If WindowState = 1 Then Exit Sub
Dim ChW As Long, ChH As Long
ChW = Width - LastWidth
ChH = Height - LastHeight
Command1.Move Command1.Left + ChW, Command1.Top + ChH
Command2.Move Command2.Left + ChW, Command2.Top + ChH
Check1.Move Check1.Left, Check1.Top + ChH
Label2.Move Label2.Left, Label2.Top + ChH / 3
Label3.Move Label3.Left, Label3.Top + (ChH / 3) * 2
Text1.Move Text1.Left, Text1.Top, Text1.Width + ChW, Text1.Height + (ChH / 3)
Text2.Move Text2.Left, Text2.Top + ChH / 3, Text2.Width + ChW, Text2.Height + ChH / 3
Text3.Move Text3.Left, Text3.Top + (ChH / 3) * 2, Text3.Width + ChW, Text3.Height + ChH / 3
LastWidth = Width
LastHeight = Height
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -