📄 利用随机码防止密码被窃取.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 2280
ClientLeft = 60
ClientTop = 345
ClientWidth = 3720
KeyPreview = -1 'True
LinkTopic = "Form1"
ScaleHeight = 2280
ScaleWidth = 3720
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command1
Caption = "确定"
Height = 375
Left = 2520
TabIndex = 6
Top = 960
Width = 975
End
Begin VB.TextBox Text3
Enabled = 0 'False
Height = 270
Left = 180
TabIndex = 5
Top = 1860
Width = 1995
End
Begin VB.TextBox Text2
Enabled = 0 'False
Height = 270
Left = 180
TabIndex = 4
Top = 1140
Width = 2055
End
Begin VB.TextBox Text1
Height = 270
IMEMode = 3 'DISABLE
Left = 180
PasswordChar = "*"
TabIndex = 0
Top = 420
Width = 2055
End
Begin VB.Label Label3
Caption = "请输入密码:"
Height = 255
Left = 180
TabIndex = 3
Top = 120
Width = 1875
End
Begin VB.Label Label2
Caption = "你输入的密码:"
Height = 255
Left = 180
TabIndex = 2
Top = 1560
Width = 1995
End
Begin VB.Label Label1
Caption = "伪密码:"
Height = 255
Left = 180
TabIndex = 1
Top = 840
Width = 1875
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim X As Long
Dim Str As String
Private Sub Command1_Click()
Text2.Text = Text1.Text
Text3.Text = Str
If Str = "shiming" Then
MsgBox "密码正确"
Else
MsgBox "密码错误"
End If
End Sub
Private Sub Form_Load()
Randomize
End Sub
Private Sub Text1_GotFocus()
Str = ""
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
Str = Str + Chr(KeyAscii)
X = Int(122 - 48 + 1) * Rnd + 48
KeyAscii = Asc(Chr(X))
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -